Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My computer is Windows 7 and has Powershell running, I'd like to execute commands to pull back information (specifically netstat) from a bunch of other machines (Windows XP) that do not have Powershell. Is this possible with Powershell or do I need to find another solution?

share|improve this question

migrated from Sep 10 '11 at 17:24

This question came from our site for information security professionals.

In order to execute Powershell remotely you need to have Powershell installed on the remote machine. What you want is to use something like PsExec:

share|improve this answer
If he's just running netstat.exe, he could use PsExec to run just that command remotely. Although I am curious what he might be trying to get that WMI doesn't have access to. A lot of it ought to be in Win32_PerfRawData_Tcpip_TCP. – Bacon Bits Sep 10 '11 at 17:40

PowerShell remoting is indeed out out the picture. But alot of information you could still gather via WMI. Another technique I've used in the past is to remotely schedule a task on other computer to run a script "locally" to get the information you want. This works great for things like netstat.

share|improve this answer

You can do this with Powershell with the target machines not running Powershell. Use Invoke-Command to run netstat remotely on a targetted computer.

share|improve this answer

You can do this any number of ways, but the amount of information you can get will vary widely by the technique you use.

I'd recommend taking a look @ Get-WmiObject -computerName. This will use WMI's native remoting to communicate to XP and Windows 2000 (or any newer OS). You will not be able to do everything you can do with full PowerShell, but you will be able to do everything you can with WMI on Windows XP, and you'll be able to remotely manage this from PowerShell on a single box.

The EventLog is also open remotely in a similar mechanism. Use Get-EventLog -ComputerName to get remote event log entries from XP or 2000.

Hope this Helps

share|improve this answer

You can use the Get-WMIObject cmdlet with the -ComputerName parameter, you will need admin rights on the remote machine:

Get-WMIObject Win32_BIOS -ComputerName Contoso-Client -Credential Get-Credential

Use the -Credential if you are using a different account on your local computer that doesn't have rights to the remote machine, you will need credentials of an account that has admin access on the remote machine.

share|improve this answer

You must log in to answer this question.