Exchange 2010 | Get-MailboxStatistics where子句

我有交换服务器托pipe多个域的电子邮件。 如何使Get-MailboxStatistics cmdlet仅在以特定域结尾的邮箱上显示邮箱和大小?

就像Get-MailboxStatistics WHERE EmailAddressEndsWith *emaildomain.com

谢谢。

只需创build一个报告,显示邮件地址以@YOURDOMAIN结尾的所有邮箱:

 Get-Mailbox -ResultSize Unlimited | Select-Object Name, PrimarySMTPAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses -cmatch "smtp"}} | Where-Object {($_.PrimarySMTPAddress -like "*YOURDOMAIN*")} 

你也可以像这样运行它,

 get-mailboxserver | get-mailbox -ResultSize 0 | where {$_.PrimarySMTPAddress -like '*@example.com'} | Get-MailboxStatistics | select * | Export-Csv C:\mailbox-stats.csv