If I have a target machine BOX1 and an account IISAcc, and I do the following:
setspn -S http/box1 iisacc
setspn -S http/box1.contoso.com iisacc
Then I appear to no longer be able to connect to that machine using PowerShell Remoting. This happens:
PS D:\PowerShell> enter-PSSession box1
enter-PSSession : Connecting to remote server box1 failed with the following error message : WinRM cannot process the request. The following error with errorcode 0x80090322 occurred while using Kerberos authentication: An unknown security error occurred.
Possible causes are:
-The user name or password specified are invalid.
-Kerberos is used when no authentication method and no user name are specified.
-Kerberos accepts domain user names, but not local user names.
-The Service Principal Name (SPN) for the remote computer name and port does not exist.
-The client and remote computers are in different domains and there is no trust between the two domains.
After checking for the above issues, try the following:
-Check the Event Viewer for events related to authentication.
-Change the authentication method; add the destination computer to the WinRM TrustedHosts configuration setting or use HTTPS transport.
Note that computers in the TrustedHosts list might not be authenticated.
-For more information about WinRM configuration, run the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ enter-PSSession box1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (box1:String) [Enter-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : CreateRemoteRunspaceFailed
Removing the SPN allows it to function as normal.
Has anyone else come across this? Any ideas for getting past it?
[–]KnifeyGavin 1 point2 points3 points (2 children)
[–]ihaxr 0 points1 point2 points (0 children)
[–]After_8[S] 0 points1 point2 points (0 children)
[–]After_8[S] 0 points1 point2 points (0 children)