Solved

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

Posted on 2011-02-23
6
351 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
How to sign a powershell script so you can prevent tampering, and only allow users to run authorised Powershell scripts
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

821 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