Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

migrated from security.stackexchange.com Sep 10 '11 at 17:24

This question came from our site for Information security professionals.

5 Answers

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: http://technet.microsoft.com/en-us/sysinternals/bb897553.

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
add comment

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
add comment

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
add comment

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.