2

I'm trying to run the get-service command on a remote machine in powershell. After doing some research, it appears this is only possilbe n powershell 2 CTP, which I cannot use as I need to use the version of powershell installed with exchange, which is usualy 1. It seems the -computerName switch is only availible in get-service in ps 2. So i've pretty much decided its a no-go, but wanted to see if anyone here had an clever solutions before I give up on it.

1
  • Sam, most of the "remote' capabilities from PowerShell V1 are either via WMI and/or using .NET classes directly. /n Software also has an PowerShell SSH server which works with V1. Commented Jan 15, 2009 at 13:49

3 Answers 3

6

Those are all fine answers but they only help you with Services. What you want is somethign that will work with anything:

WINRS is your best friend!

[4120:0]PS> winrs -r:localhost powershell get-service h*

Status   Name               DisplayName
------   ----               -----------
Running  hidserv            Human Interface Device Access
Running  hkmsvc             Health Key and Certificate Management
Stopped  HomeGroupListener  HomeGroup Listener
Running  HomeGroupProvider  HomeGroup Provider

BTW - WINRS uses WS-MAN which means it will work across firewalls.

Experiment! Enjoy! Engage!

Jeffrey Snover [MSFT] Windows Management Partner Architect

Sign up to request clarification or add additional context in comments.

1 Comment

To set up your machines, start with the command "winrs quickconfig".
5

Well, you can go directly to WMI the get the service information.

gwmi Win32_Service -computername FOO

Comments

4

This will work in v1:

[System.ServiceProcess.ServiceController]::GetServices("String machineName")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.