Het is volstrekt belachelijk dat Microsoft in de Exchange Management Console niet standaard laat zien hoe groot een mailbox is en hoeveel items deze bevat! Dat gezegd hebbende wil ik ook nog het volgende kwijt: Powershell is volmaakt, Powershell kan alles. Ahum.
Goed. Aan de slag. Moeilijk is het niet. Allereerst de Exchange Management Shell starten, alle benodigde cmdlets worden dan automatisch ingeladen. En stap 2 is het onderstaande script erin mikken.
Let even op hoe je database heet. Dit is te zien in de Exchange Management Console onder Microsoft Exchange > Microsoft Exchange On-Premises > Organization Configuration > Mailbox. Onder het eerste tabblad, Database Management, is de databasenaam te zien: Mailbox Database *10-cijferig nummer*.
Get-MailboxStatistics -Database "Mailbox Database 0000000000" | Sort -Property TotalItemSize | Select @{Expression={$_.DisplayName};Label="Gebruikersnaam"}, @{Expression={$_.ItemCount};Label="Aantal mails"}, @{Expression={$_.TotalItemSize.Value.ToMB()};Label="Grootte in MB"}Hardstikke leuk zo. Nog handiger is het om deze data in Excel te krijgen, daar zijn zo’n 19 extra karakters voor nodig in het PS commando, en wel de volgende:
| Export-CSV ExchangeMailboxSummary.csvKortom, dit script doet de truc.
$vandaag = (Get-Date).ToString('yyyy-MM-dd'); Get-MailboxStatistics -Database "Mailbox Database 0000000000" | Sort -Property TotalItemSize | Select @{Expression={$_.DisplayName};Label="Gebruikersnaam"}, @{Expression={$_.ItemCount};Label="Aantal mails"}, @{Expression={$_.TotalItemSize.Value.ToMB()};Label="Grootte in MB"} | Export-CSV "$vandaag-ExchangeMailboxGrootte.csv"
Leave a reply