Categories
Administration Windows

Using SC to stop remote services

I generally use PSExec from the Sysinternals Suite, but here is another approach if you are not allowed to install external tools or it is blocked by (say) a virus checker:

Use sc.exe to achieve the same end result e.g.

1
2
3
4
5
6
7
8
9
10
11
12
13
REM
REM Establish IPC connection so we are authenticated with the remote machine
REM
net use \\remote\IPC$ /user:local-username-on-remote-machine remote-user-password 
REM 
REM Use system console (sc.exe) command line tool to STOP or START services on remote machine
REM Note: The service name needs to match the one shown in services on the remote machine
REM
sc \\remote stop service-name 
REM
REM Delete the IPC credentials
REM
net use \\remote\IPC$ /delete

This is particularly useful in larger PeopleSoft installs where you have installed the Web servers/App servers/Process Schedulers as NT services. You did do that didn’t you? 🙂

Note: This came from a posting somewhere else on the web – I am not claiming it is my idea!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.