Powershell Exchange mailboxsizes

Kelly Garcia
Kelly Garcia used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2007
Commented:
$mailboxes = get-mailbox -resultsize unlimited | where {$_.issuewarningquota -ge 900mb}
foreach ($mailbox in $mailboxes) {
  $stats get-mailboxstatistics $mailbox
  if ($stats.totalitemsize.value.togb() -ge 1) {
   'Account {0} located on {1} - {2} is using {3} mb of storage' -f $mailbox.samaccountname, $mailbox.servername, $mailbox.database.tostring(), $size.value.tomb()
  }
}

Open in new window

Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
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.
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial