mrbios Posted September 23, 2010 Posted September 23, 2010 I want a script that'll force another script to run with account credentials i specify but i want it to be secure so no one can see the password from it while it's running basically what im aiming to do is give teachers the ability to restart the print spooler service which they can't do under their accounts, i've got my net stop spooler net start spooler bit in a batch file, but i need something that'll run that script as an administrator. I know that in a batch file i can do runas /user:domain\user but this asks me for the password and it's not secure even if it did let me put the password in. Thanks for any help on this
box_l Posted September 23, 2010 Posted September 23, 2010 Hi, This is how I do it. See attached .rar file It contains a runas .vbs and a way to use screnc to encode them. encoded files are placed in the "encoded" folder as .vbe. Windows will execute them as if the were .vbs. They can be decrypted, but a user will have to have a reasonable bit of knowledge to do it. BoXvbsencoder.rar 2
mrbios Posted September 23, 2010 Author Posted September 23, 2010 Thank you very much box_l that's even better than i was hoping for
SYNACK Posted September 23, 2010 Posted September 23, 2010 You could also just assign them the rights to restart the service via GPO and simply have the script run as them. This way there is no possibility of them retriving the password or retasking the rights. How To Configure Group Policies to Set Security for System Services 1
Mr.Ben Posted September 23, 2010 Posted September 23, 2010 Here is how I do it in a vb script... (in this case to register FoxIT as the default pdf viewer).... 'On Error Resume Next strCmd="""C:\PROGRA~1\FOXITS~1\FOXITR~1\FOXITR~1.EXE -Register""" strUser="[email protected]" strPass="adminpassword" set WshShell=CreateObject("WScript.Shell") WshShell.Run "runas.exe" & " /user:" & strUser & " " & strCmd WScript.Sleep 1500 WshShell.Sendkeys strPass & "~" 1
mrbios Posted September 23, 2010 Author Posted September 23, 2010 Thanks guys, synack i must be being simple today, normally things like that pop straight into my head, thank you very much i think i'll use that route!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now