Psexec inside the visual studio

I am trying to get psexec to run executable files on remote computers from custom build tasks in visual studio. All of these commands work from the command line, but starting from the application seems to be a problem. Some commands work, psexec hangs on others, and therefore msbuild and visual studio 2005. In this case, I call SharePoint stsadm.exe, but this problem occurs with a large number of programs when psexec starts from the application. There are many people having this problem, but there seems to be no solution, so my question is: does anyone know a working alternative to psexec?

+4
source share
3 answers

I experienced β€œhangs” when running PSEXEC on a remote system, but I always attributed it to the security context in which the remote process was running.

From the PSEXEC Help:

If you omit the username of the remote process, it starts in the same one that you are running PsExec, but because the remote process impersonates it will not have access to the network of resources on the remote system . when you specify the username of a remote process, the process runs in the specified account, and will have access to any network resources that access it. Note that the password is transmitted in the clear text of the remote system.

If you are executing a process remotely, which then must access the database (stsadm.exe), then a failure may occur when you try to access a network resource, depending on how PSEXEC is executed. If this is the case, I would suggest that eventually it will end and provide some message about the unavailability of the resource.

There are two things that usually happen when you perform the deployment steps on a remote machine to prevent the behavior that you describe:

  • As mentioned above, make sure that all assets needed for deployment are local to the remote machine (copy files, etc.) before using PSEXEC to execute the script (* .bat, * .vbs, * .ps, etc.) - so that everything works "locally" to the remote machine.

  • Launch PSEXEC using the domain username / password when it is executed - note that this information is sent in clear text to the remote server.

+1
source

Always RCE .

RemCom is a small (10KB upx packed) replacement for remoteshell / telnet, which allows you to execute processes on a remote windows computer, copy files on remote computers of the system, process its flows back. This allows you to execute remote shell commands directly from the full interactive console without having to install any client software. On local machines, it is also capable of impersonating itself, so it can be used as a silent replacement for the Runas command.

0
source

You can try psexec to invoke a bat program that does what you need on the remote machine. I encountered this problem with installutil.exe. A simple bat file on a remote computer resolved it.

You should also share your experience on the sysinternals board. There may be something in the future that they can do.

0
source

All Articles