After upgrading my management workstation from Windows 8.1 Pro to Windows 10 Pro (version 22H2), I suddenly couldn't connect to my Hyper-V Server 2012 R2 Core machine (hostname: HYPERV01) using Hyper-V Manager. Both machines are domain-joined and on the same subnet. The error message clearly pointed to WinRM communication issues:
[Window Title]
Hyper-V Manager
[Main Instruction]
An error occurred while attempting to connect to server "HYPERV01". Check that the Virtual Machine Management service is running and that you are authorized to connect to the server.
[Content]
The operation on computer 'HYPERV01' failed: WinRM cannot complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM the same local subnet.
First, I verified basic connectivity:
Test-NetConnection HYPERV01 -Port 5985
This confirmed TCP port 5985 (WinRM HTTP) was reachable. Next, I checked the WinRM service status on both machines:
# On HYPERV01 (run remotely via SSH or physical console)
Get-Service WinRM
# On Windows 10 workstation
Get-Service WinRM | Select Status, StartType
After hours of troubleshooting, running this single command on the Hyper-V server resolved the issue:
Enable-PSRemoting -Force
Interestingly, I didn't even need to execute the subsequent winrm set
commands that are typically recommended. This suggested that a recent Windows Update might have reset the firewall rules on the server.
For those experiencing similar issues, here's the complete remediation process:
# 1. On Hyper-V Server 2012 R2 (run as Administrator)
Enable-PSRemoting -Force
Set-NetFirewallRule -Name WINRM-HTTP-In-TCP-PUBLIC -RemoteAddress Any
# 2. On Windows 10 management workstation
winrm quickconfig
winrm set winrm/config/client '@{TrustedHosts="HYPERV01"}'
# 3. Verify connectivity
Test-WSMan HYPERV01
Enter-PSSession -ComputerName HYPERV01 -Credential (Get-Credential)
To avoid future disruptions:
# Export current WinRM configuration
winrm export C:\backup\winrm_config.xml
# Create scheduled task to periodically verify settings
$action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument 'Enable-PSRemoting -Force'
$trigger = New-ScheduledTaskTrigger -Weekly -DaysOfWeek Sunday -At 3am
Register-ScheduledTask -TaskName "Verify WinRM Configuration" -Action $action -Trigger $trigger -User "SYSTEM"
After a Windows 10 update, many administrators report being unable to connect to Hyper-V Server 2012 R2 using Hyper-V Manager. The error message typically indicates WinRM connectivity issues:
WinRM cannot complete the operation. Verify that the specified computer name is valid,
that the computer is accessible over the network, and that a firewall exception for the WinRM
service is enabled and allows access from this computer.
Before proceeding with solutions, confirm these symptoms match your scenario:
- Previously working Hyper-V Manager connections suddenly fail
- Both machines are domain-joined and on the same subnet
- Basic network connectivity tests (ping, nslookup) succeed
- Windows Remote Management service is running on both machines
The most effective solution is often running this PowerShell command on the Hyper-V server:
Enable-PSRemoting -Force
This single command typically resolves the issue by:
- Configuring WinRM service to start automatically
- Creating the required firewall rules
- Setting up the default WSMan listener
If the basic fix doesn't work, try these additional measures:
1. Verify WinRM Service Status
Get-Service WinRM | Select-Object Status, StartType
Expected output:
Status StartType
------ ---------
Running Automatic
2. Check Firewall Rules
On both client and server, verify these rules exist and are enabled:
Get-NetFirewallRule -DisplayGroup "Windows Remote Management" |
Where-Object { $_.Enabled -eq $true } |
Format-Table DisplayName, Enabled
3. Test Basic WinRM Connectivity
Test-WSMan -ComputerName HYPERV01
For enterprise environments, consider these robust configurations:
# Configure WinRM for domain authentication
winrm set winrm/config/service '@{AllowUnencrypted="false"}'
winrm set winrm/config/service/auth '@{Basic="false";Kerberos="true"}'
# Set trusted hosts (use cautiously in production)
winrm set winrm/config/client '@{TrustedHosts="*.yourdomain.com"}'
# Verify configuration
winrm get winrm/config
- Never disable Windows Firewall completely - modify specific rules instead
- Avoid using HTTP transport (5985) when HTTPS (5986) is available
- Remember that Group Policy may override your local settings
- Double-check DNS resolution in both directions
After applying fixes, test connectivity with:
Enter-PSSession -ComputerName HYPERV01 -Credential (Get-Credential)
Successful connection indicates the issue is fully resolved.