Solved

Start/stop services on server from another pc.

Posted on 2004-09-01
2
227 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

732 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