我需要运行一个 Get-Mailbox | Get-MailboxStatistics 命令跨越大量邮箱,但大多数从未使用过,因为它是新安装的。结果,我不得不坐过几百行
WARNING: There is no data to return for the specified mailbox '<mailbox DN>' because it has not been logged on to.
看来我需要使用某种服务器端过滤器,但我找不到任何合适的东西。
我可以在这里做什么?
我需要运行一个 Get-Mailbox | Get-MailboxStatistics 命令跨越大量邮箱,但大多数从未使用过,因为它是新安装的。结果,我不得不坐过几百行
WARNING: There is no data to return for the specified mailbox '<mailbox DN>' because it has not been logged on to.
看来我需要使用某种服务器端过滤器,但我找不到任何合适的东西。
我可以在这里做什么?
Get-MailboxStatistics 中没有服务器端过滤,我无法重现它。你可以试试这个:
获取邮箱 | Get-MailboxStatistics -warningAction 静默继续
这是警告的标准 PS 行为。您可以在 common_parameters 的帮助中找到 Shay 的参数get-help about_common_parameters
。或者,您可以设置$WarningPreference = silentlycontinue
. 由于邮箱尚未初始化,因此没有要返回的统计信息,因此会发出警告。