Running Net Use or AT command as different user
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
Running Net Use or AT command as different user

 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming
Author Message
Microsoft News
Guest





Posted: Mon Dec 20, 2004 9:30 pm    Post subject: Running Net Use or AT command as different user Reply with quote

I am writing a batch file that will be ran on our servers to archive the
Event Logs using the autobackup registry key.

Once an event log is archived, I need to move that file off of the server it
was initially located on to a default storage space.

I am using the AT command to schedule this task, but I am unable to get this
command to run as another user.

Does anyone know how I can automate this process so batch file can use
another user's credentials to either run the AT command or run the Net Use
command so no password is asked for when the script is ran????
Back to top
SubnetJO
Guest





Posted: Mon Dec 20, 2004 10:35 pm    Post subject: RE: Running Net Use or AT command as different user Reply with quote

There is a way.
There is a service called "Secondary logon" (seclogon) that allow you to run
commands under different credentials.

Seclogon has a problem, work "on line" only.
That means there isn't a way to pass credentials (the password) in "batch
mode".
The related command is "runas".

Available in the resource Kit there is a service called "SU".
This tool installs itself as a service (disply name, "SU") and provide a
command line interface through the "su.exe" command.
Something like the "SU" comand of unix systems.
This tool has a GUI, too.

The SU tool accept standard input!
So you can pass parameters to it using the "pipe" (|) or redirecting the
content af an ascii file (<).

WARNING!
The SU tool provided with the resource kit DOESN'T WORK!
It has a bug.
This bug is documented by Microsoft that fixed it.
The "bug free" version of the tool is NOT available for free download.
May be requested to Microsoft support, if you have subscribed it.

I know, It seems incredible to me too, but that is...

Bye,
SubnetJO
Italy







"Microsoft News" wrote:

Quote:
I am writing a batch file that will be ran on our servers to archive the
Event Logs using the autobackup registry key.

Once an event log is archived, I need to move that file off of the server it
was initially located on to a default storage space.

I am using the AT command to schedule this task, but I am unable to get this
command to run as another user.

Does anyone know how I can automate this process so batch file can use
another user's credentials to either run the AT command or run the Net Use
command so no password is asked for when the script is ran????


Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB