![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | RE: remote service Have you tried using WMI for this? gwmi -computer unity1 win32_service -filter "name='alerter'" | foreach-object { if ($_.State -eq 'Running') {"Put your command here"}} Now I wasn't clear if you wanted to run a command remotely, this example will just execute a command on whatever machine is running the powershell session. "Blake" wrote: Quote: > 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 Specs![]() |
| | #3 (permalink) |
| Vista Ultimate 32bit | Re: remote service Although you can still use WMI to remotely manage the server. Here's another way: Managing Services with PowerShell and ADSI | SAPIEN Technologies |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Remote Assistance w/Service Pack 2 | Vista General | |||
| stopping remote service from VM | PowerShell | |||
| Remote Regestry Service | Vista General | |||
| Remote Installation Service | Vista installation & setup | |||
| MSN Remote Record Service Fails | Vista General | |||