• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 722
  • 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 StanNetwork AdministratorCommented:
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 StanNetwork AdministratorCommented:
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
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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