Solved

Exchange 2007 poweshell script or any script to get a particular store mailbox sizes.

Posted on 2011-02-23
6
349 Views
Last Modified: 2012-05-11
Hi,

Exchange 2007 poweshell script or any script to get a particular store mailbox sizes.

Can anyone help me with this. All users in a store in a server to get the details into a CSV with name and mailbox size in MB.

regards
Raja
0
Comment
Question by:bsharath
  • 3
  • 3
6 Comments
 
LVL 4

Expert Comment

by:karim_hashish
ID: 34965931
Hello Raja,

If i understand your question correctly let me rephrase, you have for example a database named DB01 and you want to get the mailboxes in that database where for example the mailbox size is between 15 and 20 MB then export the the mailbox displayname and the size to a csv file.

If so kindly find the below code you can use to get the results you desire.

PS: the totalitemsize property specified in the below command are in KB.

IF you still have any concerns, don't hesitate to refer back

Best Regards,

Karim
Get-MailboxStatistics -Database "EX07\First Storage Group\Mailbox Database" | where {($_.totalitemsize -gt 9000) -and ($_.totalitemsize -lt 10000)} | select displayname, totalitemsize | export-csv c:\result.csv

Open in new window

0
 
LVL 11

Author Comment

by:bsharath
ID: 34966787
Thanks
I will need all mailboxes and not finding with any limit
Extract all mailbox names and sizes to csv.
Also the database path that i need to mention in code. Where can i see it
0
 
LVL 4

Expert Comment

by:karim_hashish
ID: 34967630
Hello

Thanks for clarifying . in order to get the mailbox database identity try the below command first

Get-MailboxDatabase -Server servername | select identity

Then mark and copy the identity of the desired database

Then use the copied identity in the below command to export all mailboxes to a csv file

Get-MailboxStatistics -Database "EX07\First Storage Group\Mailbox Database" | select displayname, totalitemsize | export-csv c:\result.csv

Hope it will help you

if you still have any problems don't hesitate to contact me back

Best Regards,

Karim
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 11

Author Comment

by:bsharath
ID: 34967646
Thanks
I get the details in Bytes

"11131740B"

Can this be in MB please
0
 
LVL 4

Accepted Solution

by:
karim_hashish earned 500 total points
ID: 34968001
Hello

Kindly try to do this as below

Get-MailboxStatistics -Database "EX07\First Storage Group\Mailbox Database" | select displayname, @{Name="MailSize(MB)";Expression={"{0:N2}" -f($_.totalitemsize/1mb)}}} | export-csv c:\result.csv

I'll be waiting for your feedback.

Best Regards,

Karim

0
 
LVL 11

Author Comment

by:bsharath
ID: 34968031
Thanks a lot
0

Featured Post

Highfive Gives IT Their Time Back

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

Suggested Solutions

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
A procedure for exporting installed hotfix details of remote computers using powershell
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

762 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

18 Experts available now in Live!

Get 1:1 Help Now