Friday, June 22, 2012

To check all the mailbox size on a particular Database & export to CSV file on Exchange2010 server

The following article describe how to create Mailboxes size report/s in Exchange 2010.
Step 1:
Open “Exchange Management Shell”.
Step 2:
Use one of the following commands:



To Check all the mailbox size with the no. of Items in mailbox with Send/Receive attachment size in a particular DB & export the report to CSV file, run below mentioned command in EMS;


[PS] C:\Windows\system32>Get-Mailbox -Database "Database Name" | sort-object | Select-Object name,alias,servername,Prohibi
tSendQuota,IssueWarningQuota,MaxReceiveSize,MaxSendSize,DisplayName,Database,PrimarySmtpAddress,ProhibitSendReceiveQuota
,@{n="Size(KB)";e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.totalItemsize}},@{n="Items"; e = {$MBXstat = Get
-MailboxStatistics $_.name ; $MBXstat.itemcount; $MBXstat.storageLimitStatus}} | Export-Csv C:\output.csv


Get-Mailbox -Database "Mailbox Database 2048287781" | sort-object | Select-Object name,alias,servername,ProhibitSendQuota,IssueWarningQuota,MaxReceiveSize,MaxSendSize,DisplayName,Database,PrimarySmtpAddress,ProhibitSendReceiveQuota,@{n="Size(KB)";e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.totalItemsize}},@{n="Items"; e = {$MBXstat = Get-MailboxStatistics $_.name ; $MBXstat.itemcount; $MBXstat.storageLimitStatus}} | Export-Csv C:\output.csv


For Example:
Get-Mailbox -Database "DefaultMailboxDB" | sort-object | Select-Object name,alias,servername,ProhibitSendQuota,IssueWarningQuota,MaxReceiveSize,MaxSendSize,DisplayName,Database,PrimarySmtpAddress,ProhibitSendReceiveQuota,@{n="Size(KB)";e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.totalItemsize}},@{n="Items"; e = {$MBXstat = Get-MailboxStatistics $_.name ; $MBXstat.itemcount; $MBXstat.storageLimitStatus}} | Export-Csv C:\DefaultDBMailbox.csv

Report mailboxes size in the entire Exchange organization:
Get-Mailbox | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount
Get-Mailbox | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount  | Export-CSV C:\mailboxessize.csv
Report mailboxes size in a specific Exchange server:
Get-Mailbox -server servername | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount
Get-Mailbox -server servername | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount  | Export-CSV C:\mailboxessize.csv
Report mailboxes size in a specific Exchange server database:
Get-Mailbox -server -database "Mailbox Database 0154525136" | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount
Get-Mailbox -server -database "Mailbox Database 0154525136" | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount | Export-CSV C:\mailboxessize.csv
Note: You can obtain the database name by using the command: Get-MailboxDatabase 
Report specific mailbox size:
Get-Mailbox myaliasname | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount
Get-Mailbox myaliasname | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount  | Export-CSV C:\mailboxessize.csv
Note: Instead of using “myaliasname”, you can use the “Display Name” attribute of the mailbox.

Thanks to Yuval for wonderfull blog with Tips;

http://blogs.microsoft.co.il/blogs/yuval14/archive/2011/06/08/exchange-2010-mailbox-size-report.aspx


http://social.technet.microsoft.com/Forums/pl-PL/exchange2010/thread/82d5d38a-0c13-4c16-b1b0-9999c00d354d

No comments:

Post a Comment