Enabling WinRM on Hyper-V Servers and SCVMM Servers can be done via a script using one of two options.
A). Enable WinRM in each Hyper-V server by logging to each Hyper-V server one by one to run the WinRM automation configuration script
or
B). Enable WinRM for all the Hyper-V servers through one time setup at Domain Controller by logging to just one Domain Controller and changing the group policy by running an automation script.
Please refer to the attached video for details on running this script. The script WinRMGPOConfigAgainstAD.zip can be found attached to the Knowledgebase article.
Warning: To run the script successfully, please review the following considerations:
- This is a Windows PowerShell script. The lowest supported version is 2.0. To find out the version of PowerShell on your system, on the command line, type
"Get-Host". If the PowerShell version is 1.0 or you do not have PowerShell installed, visit the Microsoft Software Download page to download a supported PowerShell version. - This script requires domain administrator privileges. You must ensure that the currently logged on user is also the domain administrator.
- To start PowerShell, click the Start button, right-click "Windows PowerShell", and choose "Run as administrator".
- By default, the execution policy is restricted, preventing any commands from executing. To make it unrestricted that, type "Set-ExecutionPolicy Unrestricted".
- To run the script, type "PowerShell -File C:\Users\dell\WinRMGPOConfigAgainstAD.ps1". Follow the prompts, and finish executing the script.
Notes:
* This script helps you to configure the Windows Remote Management(WinRM) Service automatically. You must ensure that your account belongs to Domain\Administrators, and
that you have Administrator privileges.
- When the script starts, a message prompts you to backup the GPRegistryValue that is about to be updated. If you do not want to back it up, just type 'N'.
- Next, you are prompted to specify a name for the new GPO. When you provide the GPO name, the GPO is created with the related WinRM and firewall settings.
- After the GPO is created, you are prompted to associate the newly created GPO with the related OUs, as required. You can specify one OU at a time. When finished, type 'N', as prompted.
- After the script finishes, perform a simple connectivity test by issuing the following commands:
- Enter-PSSession -computername "WIN-1HPKB8USOVB.deso.local" -credential deso\administrator
- Enter-PSSession -computername "WIN-1HPKB8USOVB.deso.local" -credential deso\administrator -Authentication Negotiate
- Enter-PSSession -computername "WIN-1HPKB8USOVB.deso.local" -credential deso\administrator -UseSSL -SessionOption (New-PSSessionOption -SkipRevocationCheck)