• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 709
  • Last Modified:

Exchange PowerShell

Get-Mailbox | Get-MailboxStatistics |
>> select DisplayName, @{n="TotalItemSize(MB)";e={$_.TotalItemSize.Value.ToMB()}
} |Sort -descending "TotalItemSize(MB)" | select-object -first 25 |ft -auto >
>>  "E:\25 Largest Mailboxes.csv"

Any idea how to include the storage group and where each mailbox is located in the above powershell script ?

Tkx
0
AXISHK
Asked:
AXISHK
3 Solutions
 
Simon Butler (Sembee)ConsultantCommented:
Both of the objects that you want are in get-mailboxstatstics, so just select them.

select Displayname, StorageGroupName ...

Simon.
0
 
Stelian StanCommented:
To acomplish that run:

Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | ft @{label="User"; expression={$_.DisplayName}}, @{label="Total Size (MB)", expression={$_.TotalItemSize.Value.ToMB()}} | Select-Object -First 25 | Export-Csv D:\test.csv

Open in new window

0
 
Stelian StanCommented:
I made some adjustments:

Get-MailboxStatistics -server kitex07a | Sort-Object TotalItemSize -Descending | ft @{label="User"; expression={$_.DisplayName}}, @{label="Total Size (MB)"; expression={$_.TotalItemSize.Value.ToMB()}} | Select-Object -First 25

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
AkulshCommented:
I think Simon is correct, so full command would look like:

Get-Mailbox | Get-MailboxStatistics |
select DisplayName, StorageGroupName, @{n="TotalItemSize(MB)";e={$_.TotalItemSize.Value.ToMB()}
} |Sort -descending "TotalItemSize(MB)" | select -first 25 |ft -auto >  "E:\25 Largest Mailboxes.csv"
0
 
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
http://www.experts-exchange.com/Software/Server_Software/Email_Servers/Exchange/Q_27846156.html

Get-Mailbox -Database "DatabaseName"| Get-MailboxStatistics | select-object DisplayName,TotalItemSize |Sort -Descending "TotalItemSize" | select-object -first 25 > C:\Size.txt

- Rancy
0
 
AXISHKAuthor Commented:
Tkx
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now