Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
62 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
10 Comments
 
LVL 9

Assisted Solution

by:Antzs
Antzs earned 1000 total points
ID: 41869543
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,totalitemcount,lastlogontime,TotalItemSize -First 10
1
 
LVL 8

Author Comment

by:Senior IT System Engineer
ID: 41869545
Thanks Anthony,

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

Accepted Solution

by:
Todd Nelson earned 1000 total points
ID: 41869567
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
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
LVL 8

Author Comment

by:Senior IT System Engineer
ID: 41869571
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 9

Expert Comment

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

exchange.png
0
 
LVL 8

Author Comment

by:Senior IT System Engineer
ID: 41869575
Hm.. that's odd.

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

Expert Comment

by:Antzs
ID: 41869577
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 8

Author Comment

by:Senior IT System Engineer
ID: 41869586
Ah yes,

I'm using Exchange 2010.
0
 
LVL 8

Author Comment

by:Senior IT System Engineer
ID: 41869614
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 9

Expert Comment

by:Antzs
ID: 41869624
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After hours on line I found a solution which pointed to the inherited Active Directory permissions . You have to give/allow permissions to the "Exchange trusted subsystem" for the user in the Active Directory...
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
This video discusses moving either the default database or any database to a new volume.

719 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