Enable PowerShell Remoting via Registry
PowerShell Remoting relies on the Windows Remote Management (WinRM)
service to accept incoming connections. While remoting is commonly
configured using the Enable-PSRemoting cmdlet, remote
connection capabilities can be managed directly within the Windows
Registry through Group Policy keys and the WinRM service
configuration.
Primary Registry Value for Remote Connections
The primary registry value that controls whether Windows allows remote connections via WinRM and PowerShell Remoting is defined under the Windows Remote Management policy key.
- Registry Path:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WinRM\Service - Value Name:
AllowAutoConfig - Value Type:
REG_DWORD - Value Data:
1= Remote connections are allowed (WinRM listeners are automatically configured).0= Remote connections are blocked.
When AllowAutoConfig is enabled, Windows also references
IP filter strings to determine which incoming IP addresses are
permitted:
- IPv4 Filter:
IPv4Filter(REG_SZ) — Set to*to allow all IPv4 addresses, or specify a specific subnet/IP range. - IPv6 Filter:
IPv6Filter(REG_SZ) — Set to*to allow all IPv6 addresses.
Enabling the WinRM Service
For remote connections to function, the WinRM service must also be configured to start automatically:
- Registry Path:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinRM - Value Name:
Start - Value Type:
REG_DWORD - Value Data:
2= Automatic (WinRM service runs automatically on boot).3= Manual.4= Disabled.
Applying Changes
After modifying these values in regedit, restart the
WinRM service or reboot the computer for the registry changes to take
effect:
Restart-Service WinRM