How to pass administrative credentials to vbs file to run in elevated privileges.
Hi,
I would like to pass administrator credentials to the vbs file to run under admin account. I have tried "RunAs" & "PsExec" utitilites, but no luck.
Please keen your valuable inputs on this.
-rv
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
anonymous_9363
9 years ago
Forget RunAs: it prompts for a password. I use PSexec all the time to run stuff with alternative credentials so I think you have an error in your command line if it's failing for you. Are you prefixing the username with a domain/computername, as it '-u SomeDomain\TheUserID -p its_password'?
Comments:
-
Hi VBScab,
Below is the command I used in non admin cmd.
PsExec -h -accepteula -u W411023\administrator -p P@ssw0rd msiexec /i "Path of msi" /qn
The above command works when I run in admin cmd but I want to make it run in normal cmd. - rvprasad 9 years ago
Posted by:
anonymous_9363
9 years ago
Ditch the '-h' switch: you don't need it if you're executing a process with an administrative account.
Why are trying to run an administrative process from a non-admin command prompt? If you're trying to test a deployment and emulate a deployment system, you should use the '-s' switch i.e. 'Run with the local System account' but you'll need to do that from an administrator-level command prompt.
I notice you don't specify a target machine name: is it going to run on W411023 or some other machine? If another machine, does 'W411023\Administrator' have any rights on that machine?