I am using a invoke-command to authenticate using domain admin credentials which are stored using read-host command.
It works flawlessly on most servers but it does not work on a bunch of servers with same permission levels as the ones which work ok.
The error message:
[servername] Connecting to remote server servername 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
Possible causes are:
-The user name or password specified are invalid.
-Kerberos is used when no authentication method and no user name are
-Kerberos accepts domain user names, but not local user names.
-The Service Principal Name (SPN) for the remote computer name and port does
-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_Troubleshooti
+ CategoryInfo : OpenError: (vtimeqa:String) , PSRemotingTransp
There is largely no difference between the server which works and the one which doesn't work.
I think my issue is similar to what is written here:
I tried to connect with IP address but still doesnt work.
No firewalls in the server which I'm trying to connect.