This information to get a mailbox report for an Exchange Organization. You can change some parameters to get a desired output, if you are facing any issue.
Normal Mailbox Report
To find a mailbox, we will use the below shell command
Get-Mailbox -Identity MailboxName
To get the result of all the mailbox in a Mailbox Database we can use the below shell command
Get-Mailbox -Database “Mailbox Database Name”
To get the result of Mailboxes in a Exchange Server, we can use the below shell command
Get-Mailbox -Server “Exchange Server Name”
To get the above result of all the Mailboxes, we can use Get-Mailbox on a Mailbox Database or a Exchange Server, but if we have more than 1000 mailbox, only the first 1000 mailbox will be displayed. To get all the mailbox, we have to use the below shell command
Get-Mailbox -ResultSize Unlimited
Get-Mailbox -Database “Mailbox Database Name” -ResultSize Unlimited
Get-Mailbox -Server “Exchange Server Name” -ResultSize Unlimited
How to find the entire mailbox and export them to csv file
Get-Mailbox -ResultSize Unlimited | Export-CSV C:\MailboxReport.csv
Above shell command will search for all the mailbox enable accounts in Exchange organization and the output will be passed to a csv file.
How to get the result of only the user mailbox in the exchange Server organization
Get-Mailbox -ResultSize Unlimited -RecipientTypeDetails UserMailbox | Export-CSV C:\MailboxReport.csv
Above shell command will export only the user mailbox in the exchange organization to a csv file. We can change the Recipient Type Details parameter to Room or Shared Mailbox to get the result of only the shared mailbox.
How to find the Mailbox Size Report for a Mailbox
Get-MailboxStatistics will allow an option to get the details on the mailbox size, so we can use the below shell command to find a report for single mailbox
Get-MailboxStatistics -Identity UserName | Ft DisplayName, ServerName, Database, TotalItemSize, ItemCount, StorageLimitStatus -Auto
If you want to get the above status report for all the users in a Mailbox Database or Exchange Server
Get-Mailbox -Database “Database Name” -ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName, ServerName, Database, TotalItemSize, ItemCount, StorageLimitStatus | Export-CSV C:\MailboxStatisticsReport.csv
Or to get the result for all the mailboxes in a Server
Get-Mailbox -Server “Server Name” -ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName, ServerName, Database, TotalItemSize, ItemCount, StorageLimitStatus | Sort TotalItemSize -Descending | Export-CSV C:\MailboxStatisticsReport.csv
How can I get the above mailbox size report for only the User mailbox in the Exchange Server Organization and to sort the output via Total Item Size?
Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited |Get-MailboxStatistics | Select-Object DisplayName, ServerName, Database, TotalItemSize, ItemCount, StorageLimitStatus | Sort TotalItemSize -Descending | Export-CSV C:\MailboxStatisticsReport.csv
To find the number of mailboxes on a database or a server or in a exchange server organization
To get the total number of mailboxes in your exchange server organization
(Get-Mailbox -ResultSize Unlimited).Count
If you want to get the mailbox count based on the server
Get-Mailbox -ResultSize Unlimited | Group-Object -Property:Server | Select-Object Count
Or to find the mailboxes on a database per server
Get-Mailbox -ResultSize Unlimited -Server “Server Name” | Group-Object -Property:Database | Select-Object Name, Count
Or you can find mailbox count for all the mailbox database in exchange organization, without specifying the server name
Get-Mailbox -ResultSize Unlimited | Group-Object -Property:Database | Select-Object Name, Count
HTML Report on the Mailbox Report
Below shell command will help you to get the HTML Report for User Mailbox in a Exchange Organization
Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize Unlimited |Get-MailboxStatistics | Select-Object DisplayName, ServerName, Database, TotalItemSize, ItemCount, StorageLimitStatus | Sort TotalItemSize -Descending | Convertto-HTML -Body “”| Set-Content C:\MailboxReport.htm
Or you can get the HTML Report for all the mailbox using the below shell command
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName, ServerName, Database, TotalItemSize, ItemCount, StorageLimitStatus | Sort TotalItemSize -Descending | Convertto-HTML -Body “”| Set-Content C:\MailboxReport.htm
--------------------------------------------------------------------------------------------------------------------------
1.To check whether all exchange server related services are running normal?
Test-ServiceHealth or Test-ServiceHealth -Server ServerName
1.To check the Database Mount Status, backup status
Get-MailboxDatabase -Server ServerName -Status | FT Name, Mounted, backupinprogress, lastfullbackup, lastincrementalbackup
1.If High availability configured for Mailbox Server, to check the storage group and mailbox database opy status
Exchange Server 2007 CCR -> Get-StorageGroupCopyStatus -Server ServerName
Exchange Server 2007 SCR -> Get-StorageGroupCopyStatus -Identity MBSRV\SG1 -StandbyMachine Server2
Exchange Server 2010 DAG -> Get-MailboxDatabaseCopyStatus -Server ServerName
1.To check the Mail queue status
Get-Queue -Server ServerName | FL
1.Testing Mailflow whether mail can be successfully sent from and delivered to the system mailbox on a computer that has the Mailbox server role installed
Test-Mailflow Server1 -TargetMailboxServer Server2
Test-Mailflow Server1 -TargetEmailAddress externalemailaddress
Inform if any details are needed.