我在尝试连接到远程Exchange服务器时遇到一个奇怪的问题。我花了很长时间无法建立会话,并尝试了各种尝试,直到尝试更改用户名的格式。
我正在运行的代码如下:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<SERVER>.com/PowerShell/ -Authentication Kerberos -Credential $username
如果我将$ username设置为“ DOMAIN \ username”,它将返回以下错误:
New-PSSession : [<SERVER>.com] Connecting to remote server azuks-
mgt01.wagamama.com failed with the following error message : WinRM cannot
process the request. The following error with errorcode 0x80090311 occurred
while using Kerberos authentication: There are currently
no logon servers available to service the logon request.
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.
如果我将$ username设置为“ username@DOMAIN.com”,它很高兴地建立了一个会话。我已继续并确认UPN和SAMAccountName匹配该帐户。我非常好奇这可能是什么原因,因为我一直能够在其他服务器上使用“ DOMAIN \ username”。
如果您有任何想法或想法,我想听听!