Question

I am using psexec(with MSbuild Script) to run an xCopy on a server from Jenkins(Hudson). The command runs ok when run through Command Prompt(as System user), but gives the following error when tried using Jenkins. This is the command I am using from Msbuild script:

psexec \\<RemoteMachine> /accepteula -i -u <Domian\User> -p <Pass> -s cmd /c xcopy <Path1> <Path2> /e /i 

PsExec v1.98 - Execute processes remotely Copyright (C) 2001-2010 Mark Russinovich Sysinternals - www.sysinternals.com

The handle is invalid. Connecting to ..

Couldn't access : Connecting to ...

**error MSB3073: The command "psexec \\<RemoteMachine> /accepteula -i -u <Domian\User> -p <Pass> -s cmd /c xcopy <Path1> <Path2> /e /i  " exited with code 6.**

I have tried too many options but no luck so far.

Does anyone tried the same using Jenkins? Help will be really appreciated. Are there any other ways to achieve this using some other tools without any problem. Please share.

Was it helpful?

Solution

Just wanted to post the solution here, as I figured it after some time.

The Remote Machine should have this user added in the Administrators Group.

This will resolve the connection issue. :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top