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.txtBut I just cant figure out how to get them to work together, thanks for any and all help!