cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jnfehl
Engaged Sweeper
Hey guys,

My first shot at my own custom action. I want to put gpresult.exe into our console so we can run it against machines to see if policies are running properly. However, I cannot seem to get it to run. I can't decide if it is a syntax error or if I have done something else wrong.

I installed gpresult.exe onto my server and copied the EXE into C:\Program Files (x86)\Lansweeper\Actions. I go back to the web console and run it on "X" computer and all I get is a command prompt, or a sytax error on the remote machine. My current action command is "cmd.exe /k "gpresult.exe {computer}"

Thanks in advance!

Justin
4 REPLIES 4
Salamine
Engaged Sweeper III
The /r switch is actually dependent on the version of gpresult and not the target computer.

I can only get this to work if I use a windows 7 computer with the following command.

cmd.exe /k gpresult.exe /s \\{computer} /user {username} /r

If your using a WinXP machine all you need to do is replace your gpresult file with that of one from a Windows 7 machine.

*EDIT*

I need to add, the user clicking on the action needs to be a local admin on the machine or you need to add the username and password into the command so it would look more like the following.

cmd.exe /k gpresult.exe /s \\{computer} /user {username} /u <insert network admin username> /p <insert network admin password> /r

Obviously this is not a solution you will want to go with since hovering over the action will proudly display the username and password of a network admin account.

-Sal
Salamine wrote:
The /r switch is actually dependent on the version of gpresult and not the target computer.

I can only get this to work if I use a windows 7 computer with the following command.

cmd.exe /k gpresult.exe /s \\{computer} /user {username} /r

If your using a WinXP machine all you need to do is replace your gpresult file with that of one from a Windows 7 machine.

*EDIT*

I need to add, the user clicking on the action needs to be a local admin on the machine or you need to add the username and password into the command so it would look more like the following.

cmd.exe /k gpresult.exe /s \\{computer} /user {username} /u <insert network admin username> /p <insert network admin password> /r

Obviously this is not a solution you will want to go with since hovering over the action will proudly display the username and password of a network admin account.

-Sal


Thank you for this reply. I really appreciate it! I will give it a go.
jnfehl
Engaged Sweeper
Ya, took me a while to realize that. I can't get the action to work on either OS. I must have something wrong.
rgross
Engaged Sweeper III
Dont forget, if its Windows 7, it needs to be gpresult /r