如何批量获取7万多个共享邮箱的邮箱统计数据

问题描述 投票:0回答:1

我使用的是云环境。

我最初尝试获取邮箱总数,以使用以下代码执行批量检索邮箱统计信息的脚本...但它给了我一个服务器端错误。

帮我解决这个错误。有没有其他方法来获取邮箱统计数据。因为每次运行 Get-Mailbox 都会抛出错误。

PS C:\WINDOWS\system32> ***Get-Mailbox -ResultSize unlimited -RecipientTypeDetails SharedMailbox | Measure-Object***
Write-ErrorMessage : A server side error has occurred because of which the operation could not be completed. Please try again after some time. 
If the problem still persists, please reach out to MS support.
At C:\Users\Afasdf\AppData\Local\Temp\tmpEXO_caglfdam.ak2\tmpEXO_caglfdam.ak2.psm1:1191 char:13
             Write-ErrorMessage $ErrorObject
            ~~~
     CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
     FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Write-ErrorMessage
 

***Count    : 65000
Average  : 
Sum      : 
Maximum  : 
Minimum  : 
Property :***

我希望返回租户中共享邮箱总数的计数,以便我能够使用

for
循环对检索邮箱统计数据的过程进行批处理。

powershell azure-active-directory exchange-server admin exchange-online
1个回答
0
投票

你的命令是正确的。我以前没有在这么大的组织中工作过,所以没有遇到过这个问题,但是微软有一篇关于 为大量用户运行 cmdlet 的文章 - 具体来说,尝试在服务器上执行:

Invoke-Command -Session (Get-PSSession) -ScriptBlock { Get-Mailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited | Select-Object Name,Alias } -HideComputerName

如果你经常做这种事情,RobustCloudCommand看起来很酷。

© www.soinside.com 2019 - 2024. All rights reserved.