Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RPC Command 1

Status
Not open for further replies.

bairdt

Technical User
Feb 2, 2004
32
0
0
US
Is there a way to see, from a remote server, the state of a service (Started/Stopped)?
 
Hello
Yes it's command-line tools Service Control Manager
run cmd and type: sc \\Servername query service_name state= all

I'd like to check if print server is running
sc \\192.168.56.12 query spooler state= all
and I get output. That all.
you can use that command to stop, run, pause, configure all services and drivers.
Regards
Mac foxx
 
Is there a way to say something like if it is stopped and should be started to notify me via E-mail?
 
Hi Bairdt
You can use Services > Service_name > Properties > Recovery Tab to make computer's response if services fails:
First failer: restart service
Second failer: restart service
Subsecuent failers: Run a program
I set that its send me message by NET SEND program.
If you have any smart email program you can use it.
Regards
Mac foxx

 
Any suggestions as how I can test the recovery on a service? Of course if I do it the system is ok but I want to make sure it works.
 
Go to VBScript forum I saw there man script that can send an email with attachments for example:
make batch file service.bat that include:

net start spooler {to start spooler services or any else}
sc query spooler >> c:\log.txt {to check the stat of service and write it in file log.txt}
email_script.vbs {to send email with log.txt attachments)

finally set on service recover tab all actions to run a program and fill program name: service.bat

I think it will be work.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top