Jump to content

How to find the mailbox sizes of users in Exchange 2007 through scripts


Recommended Posts

Posted

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

Posted (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 by mdrabble
Posted

Script for per database

 

Get-MailboxStatistics -database "DATABASE NAME" | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label=”TotalItemSize(MB)”;expression={$_.TotalItemSize.Value.ToMB()}},ItemCount -auto

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...