3

I'm simply attempting to open calculator on a remote machine in order to test the connection before I write a bigger script. I'm no pro with psexec yet, but I have never seen before what is happening and cannot find an answer to this question anywhere.

I'm attempting every version I know of the simple command: psexec \\target calc

My computer is running Windows 7 Enterprise. The target is running Windows 2008 R2.

When I hit 'Enter' the command seems to run as it should initially. I get the two messages about "Connecting..." and "Starting psexec...", but then nothing happens. Calculator doesn't start on the target computer, psexesvc doesn't start, I don't get any errors or messages, and I don't get control back in the cmd window I ran the command from. I have to close it.

Here is what I have tried different combinations of:

  • The -i and -d switches.
  • -u and -p with both my normal account and admin account
  • -accepteula, /accepteula, and using accepteula twice as per this post
  • Ran psExec on the target machine to manually accept the License Agreement that pops up the first time it is used
  • Checked that the Admin$ share was enabled
  • Followed most of the directions from karlchen in this post and successfully ran the three lines of code suggested.
  • Searched through any articles that seemed relevant in the psExec FAQ on the Sysinternals forums.
  • Executed programs other than calculator, like cmd and a simple batch file I put on the target's desktop
  • Left the cmd window open for a few hours just to see if it was taking it's time
  • Ran psExec at other target machines (successfully) to see if my computer is the problem
  • psList and psService work on the target computer
  • Ran cmd as administrator
  • Can successfully run this command at other servers with the same antivirus setup
  • Tried everything suggested in the two answers that have been given

None of those things changed the results or helped me find a way to change them. What else can I try for troubleshooting this problem?

Alamb
  • 181
  • 2
  • 11
  • I'm having the same problem as of yesterday: http://serverfault.com/questions/760869/psexec-slow-to-start-a-process/760872 – Mark Richman Mar 02 '16 at 18:36
  • Did you install windows updates in the last couple of days? Do you have antivirus installed? When did it update itself last? – Mark Richman Mar 02 '16 at 18:37
  • I haven't installed any Windows updates in the past couple days. The target computer just did an update for virus definitions today. – Alamb Mar 02 '16 at 18:42
  • Which antivirus are you using? I've got McAfee. Have you tried letting psexec hang there for a few minutes and see if it eventually works? Mine takes anywhere from 90 seconds to 15 minutes, and then it just wakes up from its nap and works as expected. – Mark Richman Mar 02 '16 at 18:46
  • I let it sit for 3 hours a couple days ago with no change. We've got System Center Endpoint Protection for antivirus. – Alamb Mar 02 '16 at 18:48
  • Are you able to completely disable it and retry? – Mark Richman Mar 02 '16 at 18:52
  • I have to leave it enabled. I may be able to talk to someone later and try it, but the script I will be writing after I figure this out will need to be run fairly regularly with the antivirus running. – Alamb Mar 02 '16 at 19:01
  • See if you can create an exclusion for psexec, psexesvc, or some other way to short-circuit the AV rules. I haven't had any luck doing that though. – Mark Richman Mar 02 '16 at 19:20
  • I'll let you know if I find a way! Thanks for the ideas. – Alamb Mar 02 '16 at 20:01
  • Do you have this installed? https://support.microsoft.com/en-us/kb/3134228 – Mark Richman Mar 02 '16 at 20:10

3 Answers3

1

If UAC is enabled on the target computer, you might need to turn it off. I tried it just now on a target machine that has UAC disabled, and it worked, though I got some quirky results.

Charles Burge
  • 758
  • 6
  • 16
1

I built an application that uses PSExec and had the same issues. Here are the steps I took to ensure it worked:

Things to try:

  • If either machine has antivirus, this may be causing it to hang.

  • Ensure your login details for the server/share are correct, as this may also cause it to hang.

  • Ensure the machine you are trying to connect to is accessible (you can see it within the network).

Diamond
  • 8,791
  • 3
  • 22
  • 37
Gaza
  • 215
  • 2
  • 12
  • So far, the antivirus definitions updated as recently as yesterday are the likely culprit. – Mark Richman Mar 02 '16 at 19:21
  • Ok, I just tried all 3. I just ran the calc command at a different server with the same AV setup and it worked immediately. I can RDP into the server (which I'm assuming means my login details are correct). And the server is accessible - I was able to access all its files through windows explorer on my machine. – Alamb Mar 02 '16 at 19:58
  • Do you have this installed on either machine? https://support.microsoft.com/en-us/kb/3134228 – Mark Richman Mar 02 '16 at 20:10
  • No, I don't see it on either machine. – Alamb Mar 02 '16 at 20:20
0

Firewall could be the cause of this issue. Try running this at the command prompt of your target machine ..

netsh AdvFirewall firewall add rule name=PSExec dir=In action=allow protocol=TCP localport=RPC profile=domain,private program=""%WinDir%\system32\services.exe"" service=any

This will allow PSExec through your firewall on Private and Domain connections.

chicks
  • 3,639
  • 10
  • 26
  • 36