Solved

Start/stop services on server from another pc.

Posted on 2004-09-01
2
222 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:RQuadling
2 Comments
 
LVL 4

Accepted Solution

by:
HackLife earned 125 total points
Comment Utility
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:RQuadling
Comment Utility
Thanks.
0

Featured Post

NetScaler Deployment Guides and Resources

Citrix NetScaler is certified to support many of the most commonly deployed enterprise applications. Deployment guides provide in-depth recommendations on configuring NetScaler to meet specific application requirements.

Join & Write a Comment

Article by: IanTh
Hi Guys After a whole weekend getting wake on lan over the internet working, I thought I would share the experience. Your firewall has to have a port forward for port 9 udp to your local broadcast x.x.x.255 but if that doesnt work, do it to a …
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 …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now