Is there a way to get PowerShell 2's remoting features to work between Windows XP machines?
PowerShell 2.0 has some super-snazzy remoting features. However, I'm unclear if they can be made to work with / between Windows XP machines, or if you need Windows Vista or Windows 7.
Here's what I have:
A pair of Windows XP MCE machines with SP3 installed, along with .NET 3.5.
PowerShell 2.0 CTP3 is installed on both.
WS-Management v1.1 installed on both (as 2.0 doesn't seem to work on Windows XP?)
With all that in place, the "Enable-PSRemoting" still nets me this error:
Enable-PSSessionConfiguration : Windows PowerShell remoting features are not enabled or not supported on this machine. This may be because you do not have the correct version of WS-Management installed or this version of Windows does not support remoting currently.
Ordinarily, my response at this point would be to say "well, I guess it's time to download the Windows 7 RC," but I've seen enough vague comments about people remoting in and out of Windows XP to make me think this is possible.
How can I get this to work?
Right now you can't use PowerShell remoting feature on windows XP because it depends on WinRM 2.0 CTP3 that's not available for it. Support for remoting on Windows XP will be available after final build of PowerShell V2 (and WinRM 2.0).
I know this isn't exactly what you're looking for but a possible alternative, which will almost certainly work across XP to Vista, is running your Powershell script remotely via either:
psexec - Microsoft (made by Mark Russinovich, enough said!)
rctrlx (my tool) - More powerful than psexec in certain situations
Remcom - Open source
That way you don't need to install anything on either machine apart from Powershell
I have not been able to make PowerShell work between Vista and XP or XP and XP. Looks like it is a Vista and up kind of program at this point.
I have put 10 or 15 hours into this...so maybe someone else as succeeded..but I have not bee able to achieve the needful on this one.
You can cheat using some trickery with WinRS to get it working with V1.
function Invoke-RemoteCommand
{
param(
$ComputerName,
[SCRIPTBLOCK]$script
)
$encodedScript = [System.Convert]::ToBase64String([System.Text.Encoding]::UNICODE.GetBytes($script))
$objects = Winrs "-r:$ComputerName" PowerShell -OutputFormat XML -NoProfile -NonInteractive -EncodedCommand $encodedScript
Write-Output $objects
}
Invoke-RemoteCommand localhost {gps} |where {$_.handles -ge 500} |sort handles
The -encodedScript is an undocumented switch for PowerShell.exe in V1. It just tells PowerShell to take a base64 encoded string as a command. It makes life a little easier for parsing etc if your scriptblock gets kind of long and ugly.