produce a list of all exchange mailbox users sorted by size and username

i want to produce a list of all exchange users and the size of their mailboxes
i want to use username instead of display name
and need them listed from the largest to the smallest
i tried using the following command

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object UserName,TotalItemSize -First 1500 | Export-CSV mailboxes.csv

this produces the report but the username fields are empty

if i change username to displayname it works but i dont want display name i need username
dougdogAsked:
Who is Participating?
 
Will SzymkowskiSenior Solution ArchitectCommented:
Take a look at the following link below as it provides exactly what you are looking for. There is a little more detail than piping cmdlets. You need to create new Expressions. It is very well layed out in the document step-by-step.

http://get-exchange.blogspot.ca/2009/03/did-you-ever-needed-to-supply-list-of.html

Will.
0
 
jss1199Commented:
change Username to Alias
0
 
Lord_aLi112Commented:
I can confirm the username column is empty.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
Will SzymkowskiSenior Solution ArchitectCommented:
Unfortunately when you are piping to get-mailboxstatistics username is not a valid a member of that cmdlet. If you pipe a command you can only display the member attributes for the last piped cmdlet. As you have listed above you are not interested in Display Name but that is the only attribute that is available for Name.

Will.
0
 
dougdogAuthor Commented:
so how could i get a report with
username    mailbox size
0
 
Lord_aLi112Commented:
does not work with alias neither
0
 
dougdogAuthor Commented:
can confirm alias does not work
0
 
dougdogAuthor Commented:
i will see if i can figure it out what command to use
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.