Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impersonating user on local computer

Status
Not open for further replies.

auggieIT

Programmer
Feb 22, 2007
3
US
I have a vbscript file that will stop or start certain Windows services. I have a AD group that has Admin rights to the folder in which this file is located, so they can map to the folder or logon through RDC to get to the folder. This group does not have privileges to stop or stop services on the server. I am trying to write the script to impersonate a particular account that has rights start/stop services but the script will limit the services that are affected. I have tried to use the ConnectServer option to supply a user name and password but have found that this cannot be used while on the local computer and cannot run the script remotely. The reason for the script is so that the group can only stop or start selected services and don't have full rights to all the services. How can I impersonate a different user when the script is run from the server??
 
Have you considered using the RUNAS command in your VBS file, this allows a user to essentially run a program using different user credentials.
Hope this helps.
 
This is my first experience with vbscript - I'll give it a try. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top