Cannot create remote powershell session after Enable-PSRemoting Cannot create remote powershell session after Enable-PSRemoting powershell powershell

Cannot create remote powershell session after Enable-PSRemoting


I was receiving the same problem when remoting to a server and found this blog post very helpful - http://jeffgraves.me/2013/10/14/powershell-remoting/

For my specific case I did the following:

On the Local machine

  1. winrm quickconfig (although this was already configured)
  2. winrm s winrm/config/client '@{TrustedHosts="myservername.domain"}'

On the Remote machine

  1. enable-psremoting -force
  2. Set-PSSessionConfiguration -ShowSecurityDescriptorUI -Name Microsoft.PowerShell -Force


I got around this problem by using a fully qualified logon. Instead of "netbiosdomain\accountname", I used fqdn\accountname, as in Microsoft.com\myaccount in the get-credential prompt. May not work for everyone, but it's worth a shot.


This is how I do it. I use this on my scripts.

# This is only done onceRead-Host -AsSecureString | ConvertFrom-SecureString | Out-Filec:\Windows\temp\securepass.txt# Setup credentials$SecureString = Get-Content c:\Windows\temp\securepass.txt | ConvertTo-SecureString$mycredentials = New-Object -TypeName System.Management.Automation.PSCredential    -ArgumentList "yourDomain\userID",$SecureString# Open remote session:$MyRSession = New-PSSession -ComputerName Computer1 -Credential $mycredentials    -Authentication default# Use remote session:Enter-PSSession $MyRSession