I have a MSBuild build/deployment script that, as part of it’s routine, stops and starts a couple of Windows Services from the CI server on the deployment server.
One of the commands in the script is
net.exe use \\<ip adddress of deployment computer> /user:<ip address of deployment server>\<user> <password>
As you can see, the CI server calls net on the deployment server and tells it to use a user that exists on the deployment server.
The problem is that this results in all further calls to return access denied errors.
What is the solution to this? Must I use a domain account?
you can use the net use command and specify login credentials to the remote server:
or
in this case the user you specify is a user defined locally on TheServer
after you finish do a
net use /deleteto close the connectionyou don’t have to use a domain user as long as you specify credentials that the remote server can accept
if you can’t use a server name you should be able to use an IP instead. if it doesn’t work, try mapping the server name to an IP in the hosts file (c:\windows\system32\drivers\etc\hosts)
and use the name in the net use command.
Anoher thing you should check is that it is allowed to access the file shares with non-guest accounts. look here (you do this on the server you are trying to access)