Solved

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

Posted on 2016-11-01
10
33 Views
Last Modified: 2016-11-16
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 ?
0
Comment
  • 5
  • 4
10 Comments
 
LVL 5

Assisted Solution

by:Antzs
Antzs earned 250 total points
Comment Utility
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,totalitemcount,lastlogontime,TotalItemSize -First 10
1
 
LVL 7

Author Comment

by:Senior IT System Engineer
Comment Utility
Thanks Anthony,

So how can I list the mailbox size in Gigabyte ?
0
 
LVL 14

Accepted Solution

by:
Todd Nelson earned 250 total points
Comment Utility
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,@{label="TotalItemSize (GB)";expression={$_.TotalItemSize.Value.ToGB()}},ItemCount,LastLogonTime -First 10 | Export-Csv C:\MailboxSizes.csv -NoTypeInformation

Open in new window

2
 
LVL 7

Author Comment

by:Senior IT System Engineer
Comment Utility
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 ?
0
 
LVL 5

Expert Comment

by:Antzs
Comment Utility
Without any additional switches, it is already showing the size in GB.

exchange.png
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 7

Author Comment

by:Senior IT System Engineer
Comment Utility
Hm.. that's odd.

Somehow mine only showing the ItemCount column not the size.
0
 
LVL 5

Expert Comment

by:Antzs
Comment Utility
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.
1
 
LVL 7

Author Comment

by:Senior IT System Engineer
Comment Utility
Ah yes,

I'm using Exchange 2010.
0
 
LVL 7

Author Comment

by:Senior IT System Engineer
Comment Utility
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.
0
 
LVL 5

Expert Comment

by:Antzs
Comment Utility
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
1

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create a Contact in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Contact ta…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now