Remotely starting and stopping a service on a W2008 server

I had an amazing problem starting and stopping a service on my remote server from my msbuild script.

SC.EXE and the ServiceController MSBuild task do not provide switches that allow username / password to be authenticated, so I use RemoteService.exe from www.intelliadmin.com

-Authentication with \ xx.xx.xx.xxx -Authentication Complete -Installation -Error: Access Denied

The details of the user account that I specify are for the local administrator on the server, so what ?! I tear off my hair!

Update:

OK, a bit more background. I have an XP computer in the office running the CI server. The script line connects the VPN to the data center, where I have a Server 2008 machine. None of them are in the domain.

+3
source share
4 answers

I disabled UAC and now it works.

+1
source

Often, you can connect to the IPC $ pseudo-resource on the computer to help establish credentials before running commands such as SC.EXE. Use a command, for example:

C:\> net use \\xx.xx.xx.xx\ipc$ * /user:username

* tells him to request a password.

+6
source

, script , ( : ).

0

Quick repeat question - can you use the runas command from the MSBuild script? If so, could you just pass yourself off as another user using runas / user: dsfsdf / password: dfdf sc.exe ... (or similar - I did not examine the command line options)?

0
source

Source: https://habr.com/ru/post/1696518/


All Articles