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

Comments

Please log in to comment

Answers

0
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'?
Answered 03/18/2015 by: VBScab
Red Belt

  • 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.
Please log in to comment
0

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?

Answered 03/18/2015 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share