Batch Command to tell if a service is running on a server

D

Des

Hi

I am an IT administrator for a financial firm and as part of my job I
have to carry out some pre-production tasks such as checking services
on servers and checking event logs on servers. My first question to
you is

1) Is there a batch file or script I can run to report to me if
certain services are running on a server and if so what is it? and
2) Is there some way I can filter out warnings and errors from event
logs into a text file to save me checking all events on several
servers at once


Many Thanks
 
P

Pegasus \(MVP\)

Des said:
Hi

I am an IT administrator for a financial firm and as part of my job I
have to carry out some pre-production tasks such as checking services
on servers and checking event logs on servers. My first question to
you is

1) Is there a batch file or script I can run to report to me if
certain services are running on a server and if so what is it? and
2) Is there some way I can filter out warnings and errors from event
logs into a text file to save me checking all events on several
servers at once


Many Thanks

1)
@echo off
net start | find /i "Terminal Services"
if %ErrorlLevel%==0 (set TS=yes) else (set TS=no)

2) You can use a tool such as dumpel.exe (Resource Kit)
or dumpevt (freely downloadable).
 
G

Guest

1)
@echo off
net start | find /i "Terminal Services"
if %ErrorlLevel%==0 (set TS=yes) else (set TS=no)

2) You can use a tool such as dumpel.exe (Resource Kit)
or dumpevt (freely downloadable).

NET START only tells you about the local machine.
To query/control services on remote computers,
you can also get SERVICE from
http://www.loa.espci.fr/winnt.html
and PSSERVICE from
http://www.sysinternals.com/ntw2k/utilities.shtml
(there are also other tools there in the PSTOOLS that are useful)
Another site with some similar tools:
http://wettberg.home.texas.net/freeware.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top