Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Unable to Connect when using PsExec

$
0
0

I wrote a script that uses PsExec to automate some routine remote administration on our machines. It seems to work well on the majority of our machines, but a few of them are giving us trouble. 

When the script runs on these computers I get the following in the window:

    "C:\Windows\System32\PsExec.exe : The handle is invalid.
    At line:1 char:1
    + C:\Windows\System32\PsExec.exe \\SD-020 -accepteula -i -h -s -d C:\re ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (The handle is invalid.:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError

    Connecting to SD-020...Couldn't access SD-020:"

If I connect outside of the script I get this:

    "Couldn't access SD-020:
    The network path was not found.

    Make sure that the default admin$ share is enabled on SD-020."

I have checked to make sure that remote connections are enabled on the client computers and made sure PsExec is located at the correct location on the host computer. Also, the command works on other machines, so I assume the syntax is correct. 

Anyway, is there anything that I can include in my script (or something I could do outside of it on our client machines) that might make me able to connect to these trouble machines? I've scrounged around a bit but haven't found much.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>