Jump to content

RunAs script


Recommended Posts

Im trying to create a RunAs script which is used for future scripts for standard (non admin) users. So if i create a script i dont need to tie the runas portion to the script i want running (i know i asked something similar like this few weeks back but i think itll be worth knowing how to do)

So heres the script

set WshShell = CreateObject("WScript.Shell")

WshShell.Run "runas /user:administrator@domain" "cscript.exe \\server\share$\Script.vbs"""

WScript.Sleep 100

WshShell.Sendkeys "Password~"

To me this looks corect but can anyone give me their opinions if this is incorrect or a security risk somewhere?

Is it possible to run batch files with this script too if so how if not how could i allow standard users to run certain .bat scripts when some methods coudl be tied down by policy?

Cheers

Link to comment
Share on other sites


If you 're going to use a gpo, you should be able to make what you without specifying the password in a plain text file. IE: when you're using startup script in the computer policy, the script will run with local system account so it will have all local rights.

Link to comment
Share on other sites

Yes but would this bypass some normal users policy for making certain changes? One of the things we need to do i emove the Accessories folder from all users. I managed to do this with all new users that are created in the machine but if this script runs as the user it fails - something where it gives them access then removes the access.....

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...