Solved

Start/stop services on server from another pc.

Posted on 2004-09-01
2
226 Views
Last Modified: 2010-04-11
Hi.

I'm lazy.

I'm REALLY lazy.

I want to stop/start (i.e. restart) services on different servers without having to load up VNC, Computer Management, RDP, etc.

I want a nice simple command line which will do this.

Why on earth does NET NOT support \\server I've no idea.

In truth it is only ever going to be Restart Fax Server and Restart Print Services on 2 different servers.

I have access to the server (physically and logically).

I've tried using SOON but never seem to get it to work.

Any ideas?

Richard.
0
Comment
Question by:Richard Quadling
2 Comments
 
LVL 4

Accepted Solution

by:
HackLife earned 125 total points
ID: 11949890
What you need is right here: http://www.experts-exchange.com/Operating_Systems/WinNT/Q_20896218.html

I'd like to paraphrase PeteLong:

Sc.exe is a tool that provides a way to communicate with the Service Control Manager to retrieve/manage information about services.
Netsvc.exe is a tool to remotely start, stop, and query the status of services from the command line.

You can use these tools to configure the Startup of a service and to remotely Start and Stop a service while registering the change with the Services Control Manager, as long as you have Admin priviledges on both machines.

The following example will configure the Schedule service on \\NTWORK1 to start Automatically, start it, check it's configuration and status:

sc \\NTWORK1 config Schedule start= auto
[SC] ChangeServiceConfig SUCCESS
netsvc /start \\NTWORK1 "Schedule"
Service is pending start on \\NTWORK1
sc \\NTWORK1 qc Schedule
[SC] GetServiceConfig SUCCESS
SERVICE_NAME: Schedule
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : C:\WINNT\System32\AtSvc.Exe
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : Schedule
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem
netsvc /query \\NTWORK1 "Schedule"
Service is running on \\NTWORK1
http://www.jsiinc.com/SUBA/tip0400/rh0465.htm
0
 
LVL 40

Author Comment

by:Richard Quadling
ID: 11950002
Thanks.
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Cisco Edge Routers for BGP 6 92
Why isn't my network passing a certain vlan. 24 44
VLAN 1 Line Protocol Down 9 37
qbutilities dll could not be found 27 30
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question