PDA

View Full Version : PsExec optional switches


Agent86
01-07-2011, 03:09 PM
Trying to figure how to pass the -h switch to a Run Program step which uses PsExec. I need to use this elevated token option in order to execute a batch file on the remote server.

kinook
01-07-2011, 03:36 PM
We'll add support for that (poorly documented) flag to the request list. For now, you would need to call psexec directly from a Run Program step to include it.

Agent86
01-07-2011, 03:41 PM
Thanks for the update!

tomdom
03-17-2011, 08:45 AM
Do you have any idea if this switch will be added in the near future? Really need that -h switch. I am using the remote tab from "Run Program" action. Log Psexec output is checked on.

Thanks

kinook
03-17-2011, 10:33 AM
Hopefully fairly soon, but no specific date at this time.

deramor
05-11-2011, 10:43 AM
I agree, this is poorly documented. In fact, the Microsoft msdn page that describes the switches do not even list the -h switch.

Last updated 4/29/09
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

The only way to know the switch exists is by asking PSExec its usage directly. In fact this was added in version 1.98 of PSExec. Users should make sure they are using a version that has this capability by asking it for the usage.

The workaround would be to use a the same run program action but to manually generate the command line yourself without using the remote tab. This is fine however you must know that if a password is required, it will not be encrypted. I have recently contacted support and they state this feature will be added in the next release. (currently using 7.7a)

HippyCraig
07-18-2011, 08:44 AM
I'm just courious what does the -h flag do?

kinook
07-18-2011, 09:08 AM
If the target system is Vista or higher, has the process run with the account's elevated token, if available.

HippyCraig
07-18-2011, 09:21 AM
Interesting, do you have an links that detail this further, I know its not documented on MS site but maybe a user foroum. I couldnt find anything.

Do you have an example of how to use it?

kinook
07-18-2011, 05:56 PM
The only place I'm aware of it being documented is when running PsExec without any switches and it outputs the usage. You just add -h to the command-line to use it.

HippyCraig
07-19-2011, 07:30 AM
Thanks I see it now, I was running an older version of psexec. When I updated it I can see the -h switch listed in the usage.

kinook
02-22-2012, 01:38 PM
This is available in v8.0.