【发布时间】:2019-10-08 15:01:14
【问题描述】:
当我连接到 Office365 Exchange 时,会出现一条错误消息。如何关闭此连接?
脚本:
$userCredential = Get-AutomationPSCredential -Name 'automation'
$ExoSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $userCredential -Authentication Basic -AllowRedirection
Import-PSSession $ExoSession
Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox" -or RecipientTypeDetails -eq "SharedMailbox" -or RecipientTypeDetails -eq "RoomMailbox" -or RecipientTypeDetails -eq "DiscoveryMailbox"} | Set-Mailbox -AuditEnabled $true -AuditLogAgeLimit 180 -AuditAdmin Update, MoveToDeletedItems, SoftDelete, HardDelete, SendAs, SendOnBehalf, Create, UpdateFolderPermission -AuditDelegate Update, SoftDelete, HardDelete, SendAs, Create, UpdateFolderPermissions, MoveToDeletedItems, SendOnBehalf -AuditOwner UpdateFolderPermission, MailboxLogin, Create, SoftDelete, HardDelete, Update, MoveToDeletedItems
错误:
New-PSSession : [outlook.office365.com] Processing data from remote server outlook.office365.com failed with the
following error message:
[AuthZRequestId=fe5eb99c-df73-4899-b445-ad91e0ecf1f3][FailureCategory=AuthZ-AuthorizationException] Fail to create a
runspace because you have exceeded the maximum number of connections allowed : 3 for the policy party : MaxConcurrency.
Please close existing runspace and try again.
Policy: CN=GlobalThrottlingPolicy_cfaee113-6e8e-4889-aa2c-99baf345f85f,CN=Global Settings,CN=ExchangeLabs,CN=Microsoft
Exchange,CN=Services,CN=Configuration,DC=eurprd04,DC=prod,DC=outlook,DC=com;
LockRemaining: 00:00:00 For more information, see the about_Remote_Troubleshooting Help topic.
At line:4 char:15
+ ... xoSession = New-PSSession -ConfigurationName Microsoft.Exchange -Conn ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession],
PSRemotingTransportException
+ FullyQualifiedErrorId : IncorrectProtocolVersion,PSSessionOpenFailed
【问题讨论】:
-
您是否要测试连接是否失败?
-
我们还没有收到您的来信。我的回答解决了您的问题吗?如果是这样,请点击左侧的✓ 考虑accepting。这将帮助其他有类似问题的人更轻松地找到它。
标签: azure powershell automation exchange-server ps