# Psexec error

Hi guys
When I run the command psexec \\ compname gpresult  I get
``````
``````
gpresult exited on compname  with error code 1.
``````
``````

At the same time,  At the same time, the command psexec \\ compname ipconfig  is run normally,
User which run both  the commands  is  Domain admin,remote comp is winxp

###### Who is Participating?

Commented:
Group policy changes are refreshed every 15 minutes by default, so you do not have to wait for a reboot.
0

Global Windows Infrastructure Engineer - ConsultantCommented:
It need authentication against so as to run the GPO as this need to read the registry get the GPO result

You might need to use Runas command with account that have admin priviledge on the remote computer.

This will ask for the password and take you the command prompt.

You can now run psexec \\ compname gpresult
0

Commented:
You can pass a username in PSEXEC as follows:

My oersonal experience is that if you gat error with PSEXEC it is "usually" authentication if the command passed well formed i.e. correct.

Good luck!
0

Author Commented:
I did everything as you recommend, but I get the same error.
0

Commented:
Have you got a space between the \\ and the compname?
0

Author Commented:
The computers on which I tried to debug the exec command is what is incomprehensible state, on the one hand, he responds to the ping and psexec \ \compname ipconfig, on the other hand, he does not answer the original command, and also on the VSC. I moved to another home computer (in same OU), which was responsible for VNC and tried to run a command psexec \\compname2  gpresult and get :

Make sure that the default admin\$ share is enabled on compname2.

Then I checked the group policies, and it turned out that the file and printer sharing exceptions are open to the old ip addresses domain admins. I corrected the addresses and is now waiting for the user restarts the computer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.