Enabling PowerShell Remoting

suggest change

PowerShell remoting must first be enabled on the server to which you wish to remotely connect.

Enable-PSRemoting -Force

This command does the following:

Only for non-domain environments

For servers in an Active Directory domain, PowerShell remoting authenticates with Kerberos (Default) or NTLM (Negotiate). To allow remoting to a non-domain server you have two options.

Either set up WSMan over HTTPS (which requires a certificate) or enable Basic authentication. Basic sends credentials Base64-encoded, which is not encryption, so do not use it on an untrusted network without HTTPS.

In either case you’ll have to add the remote systems to your WSMan trusted hosts list.

Enabling Basic Authentication

Set-Item WSMan:\localhost\Service\Auth\Basic $true
Set-Item WSMan:\localhost\Service\AllowUnencrypted $true

Auth\Basic turns on Basic authentication. AllowUnencrypted is also required if the listener is HTTP rather than HTTPS. Run these on the remote computer.

Then on the computer you wish to connect from, you must tell it to trust the computer you’re connecting to.

Set-Item WSMan:\localhost\Client\TrustedHosts '192.168.1.1,192.168.1.2'
Set-Item WSMan:\localhost\Client\TrustedHosts '*.contoso.com'
Set-Item WSMan:\localhost\Client\TrustedHosts *

Important: You must tell your client to trust the computer addressed in the way you want to connect (e.g. if you connect via IP, it must trust the IP not the hostname)

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents