Exchange 2010 | Get-MailboxStatistics where 子句

Exchange 2010 | Get-MailboxStatistics where 子句

我有 Exchange 服务器托管多个域的电子邮件。如何让 cmdletGet-MailboxStatistics仅显示以特定域结尾的邮箱的邮箱和大小?

就像是Get-MailboxStatistics WHERE EmailAddressEndsWith *emaildomain.com

谢谢。

答案1

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

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

答案2

你也可以像这样运行它,

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

相关内容