如何在 Exchange 命令行管理程序中过滤从未登录过的邮箱?
我需要运行 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.
似乎我需要使用某种服务器端过滤器,但我一直无法找到任何合适的东西。
我在这里能做什么?
I need to run a Get-Mailbox | Get-MailboxStatistics command across a large number of mailboxes but the majority have never been used as it is a new install. As a result, I have to sit through hundreds of lines of
WARNING: There is no data to return for the specified mailbox '<mailbox DN>' because it has not been logged on to.
It would seem that I need to use a server-side filter of some kind but I haven't been able to find anything appropriate.
What can I do here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Get-MailboxStatistics 中没有服务器端过滤,我无法重现它。 你可以试试这个:
获取邮箱| Get-MailboxStatistics -warningAction默默继续
There is no server side filtering in Get-MailboxStatistics and I can't repro it. Can you try this:
Get-Mailbox | Get-MailboxStatistics -warningAction silentlyContinue
这是警告的标准 PS 行为。 您可以在 common_parameters
get-help about_common_parameters
的帮助中找到 Shay 的参数。 或者,您可以设置$WarningPreference =silentlycontinue
。 由于邮箱尚未初始化,因此没有统计信息可返回,因此会出现警告。This is the standard PS behavior for warnings. You can find Shay's parameter in the help for common_parameters
get-help about_common_parameters
. Alternately, you can set$WarningPreference = silentlycontinue
. There are no statistics to return as the mailboxes have not yet been initialized, hence the warning.