Powershell Remoting - Remotely enabling

I recently was on site in an organisation that needed the ability to remotely run commands against each of their deployed workstations.   As the organisation didn't have a software deployment system, powershell remoting appeared to be the answer.

There is a problem however.  Even though Group Policy  allows Windows Remote Management to be enabled on remote machines, you'll find it doesn't actually work.  

Most sites recommend  manually running the command: "Enable-PSRemoting -Force" on all workstations to ensure Powershell Remoting will work correctly... somewhat of a catch-22 if you need Powershell Remoting to run the remote commands in the first place.

What's missing (by default) from the Windows Remote Management (WinRM)  Group Policy settings is a compulsory XML based schema definition that's written to the registry by calling the Enable-PSRemoting -Force command.  Thankfully, Group Policy preferences provides a simple way for fixing the "plugin" keys.

Note that two registry entries are required to be targetted by Processor Architecture.  Depending on the architecture of the client workstation the attribute of "Architecture" will change between either:

Architecture="32" or Architecture="64"

The ConfigXML details are written to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WSMAN\Plugin\Microsoft.PowerShell

Example (for 64 bit architecture)

-------------------------------------------------------

Architecture="64" UseSharedProcess="false" ProcessIdleTimeoutSec="0" RunAsUser="" RunAsPassword="" AutoRestart="false" OutputBufferingMode="Block">