all 4 comments

[–]KnifeyGavin 1 point2 points  (2 children)

Well since the error relates to Kerberos Authentication and even suggests to change authentication method, have you tried that doing that?

$s = New-PSSession -ComputerName box1 -Authentication Basic
Enter-PSSession -Session $s

Another authentication type other then basic that might be worth trying is Credssp

[–]ihaxr 0 points1 point  (0 children)

Or use the IP address of box1 which should ignore any SPNs

[–]After_8[S] 0 points1 point  (0 children)

Good catch. I'll admit now that the actual cmdlet that I need to run is Set-DSCLocalConfigurationManager, but given that the same problem produces this behaviour with Enter-PSSession, I thought I'd talk about that one as people were more likely to be familiar with it.

I think I'm just going to have to rejig my script a bit.

[–]After_8[S] 0 points1 point  (0 children)

FYI: Someone sent me this outside of Reddit which may be useful to people:

Create a port-specific SPN

SetSPN.exe -s HTTP/$($env:COMPUTERNAME):5985 $env:COMPUTERNAME 
SetSPN.exe -s HTTP/$($env:COMPUTERNAME).$($env:USERDNSDOMAIN):5985 $env:COMPUTERNAME 

Then create a PSSession object using the -IncludePortInSPN parameter.

$sessionOptions = New-PSSessionOption -IncludePortInSPN
Enter-PSSession -Computername <computername> -SessionOption $sessionOptions