Thread: remote service
View Single Post
Old 10-02-2008   #1 (permalink)
Blake
Guest


 
 

remote service

I want to see if a service is RUNNING on a remote machine (it is a Windows
2000 server and can't run PS locally)

since the remote service stuff doesn't seem fully functional in this
release, I am trying to leverage PS and the 'sc.exe' command

I have this:

c:\windows\system32\sc \\unity01 query "alerter" | foreach {"$_"} |
select-string "running"
STATE : 4 RUNNING

What I want is 'if there is some output, run another command'. So if the
service is running, I do something else.

Thanks
Blake


My System SpecsSystem Spec