Albert Widjaja
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 ?
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 ?
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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 ?
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 ?
ASKER
Hm.. that's odd.
Somehow mine only showing the ItemCount column not the size.
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.
https://blogs.technet.microsoft.com/heyscriptingguy/2013/02/27/get-exchange-online-mailbox-size-in-gb/
I am using Exchange 2013.
ASKER
Ah yes,
I'm using Exchange 2010.
I'm using Exchange 2010.
ASKER
It is still not working ?
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,@{label="Total ItemSize (GB)";expression={$_.Total ItemSize.ToString().Value.ToGB()}},ItemCount, LastLogonT ime -First 10
same result as before.
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,@{label="Total
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
https://www.petri.com/getting-mailbox-sizes-in-powershell
ASKER
So how can I list the mailbox size in Gigabyte ?