Link to home
Start Free TrialLog in
Avatar of richlionel
richlionel

asked on

List of mailboxes on server sorted by mailbox size

I have an Exchange 2007 server named Exch1.domain.com. It has about 2000 mailboxes.

I need a list of mailboxes on this server, sorted by size (MB), that includes:

DisplayName
Alias
Email Address

I should also be able to export this to CSV.

Any ideas how to do this in Powershell?
Avatar of Xaelian
Xaelian
Flag of Belgium image

Can you try:

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}}, Alias, PrimarySmtpAddress
Avatar of Manpreet SIngh Khatra
Get-Mailbox | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount

get-mailbox | get-mailboxstatistics | select-object displayname, itemcount,  lastloggedonuser, lastlogontime, lastlogofftime, servername, databasename, @{ expression={$_.TotalItemSize.Value.ToKB()} }

- Rancy
Full command to csv:

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}}, Alias, PrimarySmtpAddress|export-csv C:\stats.csv
ASKER CERTIFIED SOLUTION
Avatar of chrismerritt
chrismerritt

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
Avatar of chrismerritt
chrismerritt

@richlionel - One of my problems with Experts Exchange is when you put time and effort into helping someone who is asking a question and they don't even acknowledge it or anything. Please don't do this.

3 of us have tried to help you, please either mark one or more of the answers as the right ones sharing the points out, or instead let us know if you need more help.
chrismerritt: I agree totally with you :)
richlionel: As said it very Important you share your feedback so that if something isnt working we can try to tweek and assist you :)

- Rancy
Avatar of richlionel

ASKER

I apologise, I was ill for a few days.

I really appreciate the help from everyone in answering! I marked ChrisMerrit's answer as the correct one since that is the one I used and it did exactly what I wanted quite well.  I hope that is the right way to do things (I'm quite new to EE).

But, everyone, thanks again! I appreciate EVERYONE's input.