![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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 Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
|
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| 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 Specs![]() |
| | #3 (permalink) | ||||||||||||
| Guest | 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:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #4 (permalink) | ||||||||||||
| Guest | 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:
| ||||||||||||
My System Specs![]() | |||||||||||||
| | #5 (permalink) |
| Scripting Guru ![]() | 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 | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to start a remote service under a different user name | Flea# | PowerShell | 2 | 01-23-2008 05:26 AM |
| How to check service packs on remote computers. | Damon | PowerShell | 3 | 04-12-2007 10:00 PM |
| Remote Regestry Service | CoCUser | Vista General | 0 | 04-05-2007 07:21 AM |
| Remote Installation Service | =?Utf-8?B?QW5kcmVhcyBIZW5uaWc=?= | Vista installation & setup | 4 | 09-25-2006 02:36 AM |
| MSN Remote Record Service Fails | =?Utf-8?B?RGF2aWQgRGVMZWxsYQ==?= | Vista General | 0 | 09-13-2006 10:37 PM |