2

I am using psexec to run a exe in a remote machine which is windows 7. I need the exe to run with administrator privilege as it needs to update some registries under HKLM in the remote system.

While running psexec I am providing the credentials of an administrator account on the remote system. All is working well when UAC on the remote system is turned off.

But when UAC is turned on , the remote exe fails to start.

In have configured the exe to use manifest setting of "RequireAdministrator". What I expect is to see a UAC prompt warning of elevation when the exe is launched on the remote machine. Though it would be great if there is some way to bypass the prompt.

But unfortunately, the exe fails to launch itself. Any ideas?

user1624807
  • 271
  • 1
  • 5
  • 20

3 Answers3

5

It is the -h switch of psexec.exe which is needed. The switch is undocumented in the msdn page but you can get it in the the help (/?) of the tool. Thanks.

user1624807
  • 271
  • 1
  • 5
  • 20
1

I'm running the latest PsExec (version 1.98).

Running it without arguments I get:

-h If the target system is Vista or higher, has the process run with the account's elevated token, if available.

I'm using -h switch to remotely run an exec with elevated privileges and It works perfectly.

Be.St.
  • 4,101
  • 3
  • 25
  • 35
0

-h does not work anymore with the latest psexec utility? Have you guys not seeing this problem.

balaji
  • 1
  • 1
    I just downloaded it and am running on Windows 7 in a very strict domain. I ran `psexec \\intern1-dt -h -u domain\jweinraub pkgmgr /iu:"TelnetClient" /quiet` and it worked rather well. All I got as a response was `Error code: 0` implying it was successful. – Jon Weinraub May 29 '14 at 19:16