genesis Posted January 16, 2018 Posted January 16, 2018 Hi We use Exchange 2007 and we have separate exchange mailbox databases for the staff and students. 1) staffdatabase 2) studentsdatabase I would like to find out the mail box size of staff and student in MegaBytes I want to generate two different reports for Staff and Student with their names and mailbox sizes. Please let me know if there is a way of doing this through scripts Any tutorials will be great. Thanks
mdrabble Posted January 16, 2018 Posted January 16, 2018 (edited) How about this? Need to change $filename = 'D:\' to your chosen location and also you need to change YOURSERVERNAME to your exchange server name. My script combines all databases and sorts the list by size of mailbox - shouldn't be to hard to separate the lists. Add-PSSnapin Microsoft.Exchange.Management.PowerShell.SnapIn $DateStamp = get-date -uformat "%d-%m-%Y" $filename = 'D:\' + $DateStamp + '_MailBox_Sizes.txt' Get-MailboxStatistics -Server YOURSERVERNAME| Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage Limit”;expression={$_.StorageLimitStatus}},@{label=”Database”;expression={$_.Database}},@{label=”Last Logon Time”;expression={$_.LastLogonTime}} -auto >>$filename Edited January 16, 2018 by mdrabble
mdrabble Posted January 16, 2018 Posted January 16, 2018 Script for per database Get-MailboxStatistics -database "DATABASE NAME" | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label=”TotalItemSize(MB)”;expression={$_.TotalItemSize.Value.ToMB()}},ItemCount -auto
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now