Link to home
Start Free TrialLog in
Avatar of Kelly Garcia
Kelly GarciaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Powershell Exchange mailboxsizes

Hi All,

I need a powershell script that will tell me mailboxes above 1gb, I then need the name and email address and the move this mailboxes to a different dag. how do I do this?

thank you in advance.

regards,
kelly
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
To see maiboxes grader than 1GB you can use this command

get-mailbox | Get-MailboxStatistics | where {$_.TotalItemSize -ge 1GB} |Sort-Object TotalItemSize

To export list to c:\temp\MailboxesOver1GB.csv   (C:\Temp must exist on Exchange server)

get-mailbox | Get-MailboxStatistics | where {$_.TotalItemSize -ge 1GB} |Sort-Object TotalItemSize |Export-CSV c:\temp\MailboxesOver1GB.csv

To move it to different DAG you need to specify some more information about it.
This will give you all information about mailbox but if you want to limit it only to DisplayName and mailbox size then use this:

get-mailbox -ResultSize Unlimited | Get-MailboxStatistics | where {$_.TotalItemSize -ge 3GB} |Sort-Object TotalItemSize -Descending |Select-Object DisplayName,TotalItemSize |Export-CSV c:\temp\mailboxesOver3GB.csv