Over the past couple of weeks I have been scouring the internet to figure out a problem I have been having of simply getting "calculator" to open on a remote computer using psExec. Eventually I asked a question on here too. I still don't have an answer to that question, but getting help with that question turned into a lot of back-and-forth answers and comments on different ways to troubleshoot psExec. I'm grateful for the help I received, so I was looking over the list of troubleshooting ideas I got and thought - wouldn't it be nice if I could just search "troubleshoot psExec" and get this list all in one place, rather than digging for little helpful nuggets on tons of different websites?
So, with that in mind, and in the spirit of the Answering Your Own Questions post, I'm going to list all of the troubleshooting methods I've found out about, then I'll ask my question. I can't add many links yet because I'm new to this site, so I apologize for the minimal inclusion of credit and links to sources.
- In the
\\targetmachine
part of the command, try using either the computer name or the ip address. Sometimes one doesn't work when the other will. - Use the
-i
switch to make the program interactive on the remote machine. - Use the
-d
switch socmd
doesn't hang while the program you are executing is still running. - Attempt to run simple programs other than the program you're trying to run (ex.
calc
,cmd
, or make a simple.bat
file to test), to check if your syntax is wrong. - Target a different computer with a similar command to see if the command works.
- If you've tried the
-d
switch already, run your program and let it hang for a while to see if the system is running slowly. Sometimes some programs will take a bit of time. - Run other psTools like
psList
orpsService
to check if you have access to the remote machine - Another way to check if the target computer is accessible to the local machine is to open a windows explorer window and type in the address bar:
\\targetcomputername\c$
. This should give you access to the folders in the target's C: drive. - Run
cmd
as an administrator - Use the username and password switches (
-u
and-p
). Try with your regular account then try with your admin account (if you have one). - accepteula can be written both as
-accepteula
and/accepteula
- apparently one way works with some systems, one way works with others. - Insert
-accepteula
twice in your command, because the first one just gets 'swallowed' sometimes and doesn't get executed (from this post). - Go to the target machine via remote connection or physically working on it, and run
psExec
in a command prompt so you can manually accept the License Agreement that pops up. (accepteula
is supposed to do this, but apparently it doesn't work sometimes) - Manually run psExec on the target computer to see if your machine is the problem.
- Check that the
admin$
share is turned on, on the target computer - Follow whatever directions are appropriate for your version of Windows from karlchen's post in the Sysinternals forums here, then run the 3 lines of code suggested.
- Check that the target's firewall or antivirus allows psExec.
- If you are able, turn off the firewall and try the command again.
- Try the command with another target that has the same antivirus and firewall setup to see if firewall/antivirus are the problem.
- Try setting UAC (User Account Controls) to "never notify"/off on the target computer.
- Try caching your credentials if you need different credentials from your own (from this post)
The psExec download page and the Sysinternals psExec FAQ and forums are great resources.
None of these troubleshooting ideas I have written here solved my problem, so that means there are more ideas out there. How else could someone troubleshoot psExec for simple problems like mine (just opening a simple program like calculator)?