troubleshooting Question

Combine Get-MailboxFolderStatistics and Get-Mailbox

Avatar of mawatson
mawatson asked on
2 Comments1 Solution2352 ViewsLast Modified:
Hey folks.

I've recently been asked to slightly amend a simple Exchange Management Shell one-liner I put together a while ago.

It goes like this:

"ServerName" | Get-MailboxServer | Get-Mailbox -ResultSize unlimited | Get-MailboxFolderStatistics | where {$_.ItemsInFolder -gt 4700} | Sort-object -descending ItemsInFolder | ft Identity, FolderPath, ItemsInFolder, @{Label="FolderSize(MB)";expression={$_.FolderSize.ToMB()} }, @{Label="FolderSize(MB)";expression={$_.FolderAndSubfolderSize.ToMB()} } -a | out-file C:\ServerName-HighItemCount.txt -width 750

It will get the mailbox server, get each mailbox on said server and then get mailbox folder statistics where ItemsInFolder is greater than 4700 items.  It'll sort the output descending by ItemsInFolder and dump out several other properties of the object.

However, what Get-MailboxFolderStatistics does not do is show the Database or StorageGroup property of the mailbox.  So, is there a way I can sort combine the two to show the StorageGroup property of the mailbox in question??  Perhaps with a variable?

Any help is much appreciated.

Chris Dent
PowerShell Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Top Expert 2010

The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros