Jump to content

psexec working on one machine and not another


ScriptFu
 Share

Recommended Posts

I have a script which opens up a rdc remotely on a Windows 7 machine using psexec.

It works perfectly on one machine, but does not work at all on the other which is using the same OS (Win 7).

Anyone has this happen to them? The second machine just does nothing when i execute the command to open the rdc.

Link to comment
Share on other sites

I can't put too much due to privacy, but this is the function which i have been using.

Func _remoteLaunch($remoteIp, $path, $username)

RunWait(@ComSpec & " /c " & "C:\pstools\psexec.exe \\" & $remoteIp & ' -u ' & $username & ' -p password -d -i 1 -w c:\windows\system mstsc "' & $path & '" /admin ')

EndFunc

and here is how i call it:

Case $button

_remoteLaunch($Ip, "c:\Users\User\Desktop\rdp.RDP", "User")

Link to comment
Share on other sites

  • Moderators

So what do you see if you change the '/c" to "/k" to keep the window open? Any errors?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

My first question would be............ ;)

The computer that's not working, is the remote management service running?

run the "winrm quickconfig" and see if you get better results. If the machine is already configured, no harm no foul.

Edited by Colyn1337
Link to comment
Share on other sites

Thanks for this.

I see 'Logon Failure: unknown user name or bad password'

I know for a fact that i have the right username and password however.

I have sorted out the bad credentials issue, it was a problem with the function parameters.

The error i now receive is 'invalid connection file ("path") specified'.

Thoughts?

Link to comment
Share on other sites

  • Moderators

RunWait(@ComSpec & " /c " & "C:pstoolspsexec.exe " & $remoteIp & ' -u ' & $username & ' -p password -d -i 1 -w c:windowssystem mstsc "' & $path & '" /admin ')

Take a look at what you have for the path to mstsc, you stop at C:windowssystem. You should be calling C:WindowsSystem32mstsc.exe (or SysWOW64 if your box is 64-bit).

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...