Wenbing Li
1 min readFeb 16, 2021

--

Enable Remote Powershell Across the Windows Domains

If the target server machine is not in the same domain where the client machine is sitting, or the client machine doesn’t join any domain, Enter-PSSession will always get the following error

New-PSSession : [<the server name>] Connecting to remote server <the server name> failed with the following error message :
WinRM cannot process the request. The following error with errorcode 0x80090311 occurred while using Kerberos
authentication: We can’t sign you in with this credential because your domain isn’t available. Make sure your device
is connected to your organization’s network and try again. If you previously signed in on this device with another
credential, you can sign in with that credential.

To solve this problem, in the server administrative powershell, you need input

Enable-PSRemoting

Then before you connect to the server with the comlet Enter-PSSession, you need setup the TrustedHosts in the client Powershell window

cd wsman:localhost\Client

Set-Item AllowUnencrypted -Value $true -force

Set-Item TrustedHosts -Value * -force

These commands will put the client Powershell more vulnerable, in term of network security. Take your own risk of doing this.

--

--