Link to home
Start Free TrialLog in
Avatar of Albert Widjaja
Albert WidjajaFlag for Australia

asked on

Need some help in modifying Exchange PowerShell to list top 10 mailbox usage in two separate MBX server ?

Hi All,

Can anyone here please assist me to combine or fix the below pwoershell script to be able to display the Top 10 largest mailbox users in GB ?

 Get-MailboxServer | Get-MailboxStatistics | sort-object -descending totalItemSize | Select -First 10 | ft -autosize DisplayName, @{expression={$_.totalitemsize.value.ToMB()};label="Mailbox Size(MB)"}, itemcount, lastlogontime 

Open in new window


There are two separate mailbox server therefore I use the Powershell command Get-MailboxServer to capture both of them, but somehow it does not work ?
SOLUTION
Avatar of Antzs
Antzs
Flag of Malaysia 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
Avatar of Albert Widjaja

ASKER

Thanks Anthony,

So how can I list the mailbox size in Gigabyte ?
ASKER CERTIFIED SOLUTION
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
THanks Todd and Anthony,

Somehow the TotalItemSize (GB) is not working ?
all of the other columns are shown, only th size is not shown both in the console and on the .CSV file ?
Without any additional switches, it is already showing the size in GB.

User generated image
Hm.. that's odd.

Somehow mine only showing the ItemCount column not the size.
If you are you using Exchange 2010, try looking at the below link.

https://blogs.technet.microsoft.com/heyscriptingguy/2013/02/27/get-exchange-online-mailbox-size-in-gb/

I am using Exchange 2013.
Ah yes,

I'm using Exchange 2010.
It is still not working ?

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,@{label="TotalItemSize (GB)";expression={$_.TotalItemSize.ToString().Value.ToGB()}},ItemCount,LastLogonTime -First 10

same result as before.
Have a go at this.  Sorry, I don't have an Exchange 2010 to test on.

https://www.petri.com/getting-mailbox-sizes-in-powershell