Quantcast
Channel: Exchange Server 2013 - Administration, Monitoring, and Performance 论坛
Viewing all articles
Browse latest Browse all 8719

Report by mailbox size and filter Powershell

$
0
0

HI all,

I just need help putting together a script that gives me a report based on mailbox size and domain used. So for instance, all mailboxes under domain1.com and the mailbox size of that user

I have found a script that will give me user names and mailbox size 

Get-MailboxStatistics-Server'SERVERNAME'|where{$_.ObjectClass-eq Mailbox”}|Sort-ObjectTotalItemSize-Descending| ft @{label=”User”;expression={$_.DisplayName}},@{label=”TotalSize(MB)”;expression={$_.TotalItemSize.Value.ToMB()}}-auto>>c:\Temp\mailbox_size.txt

And one that gives me users filtered by domain name:

Get-Mailbox -ResultSize Unlimited | Select-Object Name, PrimarySMTPAddress, @{Name="EmailAddresses";Expression={$_.EmailAddresses -cmatch "smtp"}} | Where-Object {($_.PrimarySMTPAddress -like "*domain3.ch*") -or ($_.EmailAddresses -like "*domain3.ch*")} > c:\mailboxes.txt
But I just cant figure out how to get them to work together, thanks for any and all help!

Viewing all articles
Browse latest Browse all 8719

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>