Enable PowerShell Remoting
In a PowerShell console running as administrator enable PowerShell Remoting:
Enable-PSRemoting -force
This should be enough, but if you have to troubleshoot you can use the following
commands:
Troubleshooting:
- Make sure the WinRM service is set up to start automatically.
-
Set start mode to automatic:
Set-Service WinRM -StartMode Automatic -
Verify start mode and state - it should be running:
Get-WmiObject -Class win32_service | Where-Object {$_.name -like "WinRM"}
-
Set start mode to automatic:
- Set all remote hosts to trusted.Note: You may want to unset this later.
-
Trust all hosts:
Set-Item WSMan:localhostclienttrustedhosts -value * -
Verify trusted hosts configuration:
Get-Item WSMan:localhostClientTrustedHosts
-
Trust all hosts: