Would appreciate some help. Trying to get a list of Exchange mailboxes and each mailbox’s total size. I have been able to get the Total Size to output, but am unable to output the name of the mailbox along with the size.
Does anyone have suggestions? Ideally, I would generate a text file, and each line would contain the name of the mailbox and it’s total size, separated by a comma.
The code I’ve come up with so far is as follows:
Get-Content c:\temp\litigationhold\testrun.txt| ForEach-Object {Get-Mailbox $_ | Get-MailboxStatistics | select @{e={$_.TotalDeletedItemSize.Value + $_.TotalItemSize.Value};l="Size"}| Measure-Object -Property size -Sum| select @{e={$_.Sum / 1GB}} | out-file c:\temp\litigationhold\test-output.txt -append}