Exchange 2010 Database Statistics Powersell CMDlets

Get Number of Mailboxes Per Database (Global)
get-mailbox -resultsize unlimited | group-object -property Database –noelement

Get a count of all mailboxes in database (per DB)
Get-mailboxdatabase -identity EX10mbx07 | Get-Mailbox -resultsize unlimited | Group-Object -Property:Database | FT name,count -AutoSize

Get a count of all mailboxes in Exchange
Get-Mailbox -resultsize unlimited | Group-Object -Property:Database | FT name,count -AutoSize

Get Name of Database with the lease amount of users
Get-MailboxDatabase | Select-Object Name,@{Name=”Count”;Expression={Get-MDBMailboxCount -DN $_.DistinguishedName}} | Sort-Object count

Get Database Quotas
Get-MailboxDatabase | ft name,ProhibitSendReceiveQuota,ProhibitSendQuota,RecoverableItemsQuota,RecoverableItemsWarningquota, IssueWarningQuota -auto

Set Database Quotas
Set-MailboxDatabase -identity EX10mbx47 -ProhibitSendReceiveQuota 2.3GB -ProhibitSendQuota 2GB -IssueWarningQuota 1.899GB

Get WhiteSpace for database
Get-MailboxDatabase -identity EX10mbx08 -Status | Select Servername, Name, AvailableNewMailboxSpace

Get All Mailbox Sizes over 1GB in Database and sort them by size
Get-MailboxStatistics -Database ‘EX10mbx02’ | where {$_.Totalitemsize -gt 1GB} | Sort-Object -Property TotalItemSize -Descending | Format-Table DisplayName,TotalItemSize

Get Database Mounted Status
Get-MailboxDatabase -Status | Select Name, Server, Mounted

Get ALL Quotas for the Database
Get-MailboxDatabase -Identity “EX10mbx19” | fl *quota*

Export All Users in the database
Get-Mailbox -Database EX10mbx01 -ResultSize Unlimited > c:\dame\export.txt

Get all Exchange Database Sizes in DAG
Get-MailboxDatabase -Status | Sort-Object -Property DatabaseSize -descending | ft ServerName,Name,DatabaseSize -autosize

Get Single Database Size
Get-MailboxDatabase -identity EX10mbx02 -Status | ft ServerName,Name,DatabaseSize -autosize

Get All Users in specific Mailbox Database like 2003 View
Get-MailboxStatistics -Database “Mailbox Database” | Sort -Property TotalItemsize | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime

Status information for all copies of the database and details
Get-MailboxDatabaseCopyStatus -Identity ‘EX10mbx08’ | fl name, server, activationpreference,Status,CopyQueueLength,ContentIndexState,LatestFullBackupTime, ActiveCopy,ErrorEventID,errormessage

Get ALL MOUNTED Mailbox Databases and Find the Active Servers
Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus | ? {$_.ActiveCopy -eq $true} | sort name | ft mailboxserver,DatabaseName, Status,ContentIndexState -autosize

Status for all database copies on the Mailbox server EX1001
Get-MailboxDatabaseCopyStatus -Server EX1011 | fl DatabaseName, ContentIndexState, ActiveCopy, CopyQueueLength

Get All Database Copy
Get-MailboxDatabaseCopy

Get Number of Mailboxes Per Database (Global)
get-mailbox -resultsize unlimited | group-object -property Database –noelement

Get a count of all mailboxes in database (per DB)
Get-mailboxdatabase -identity EX10mbx07 | Get-Mailbox -resultsize unlimited | Group-Object -Property:Database | FT name,count -AutoSize

Get a count of all mailboxes in Exchange
Get-Mailbox -resultsize unlimited | Group-Object -Property:Database | FT name,count -AutoSize

Get Name of Database with the lease amount of users
Get-MailboxDatabase | Select-Object Name,@{Name=”Count”;Expression={Get-MDBMailboxCount -DN $_.DistinguishedName}} | Sort-Object count

Get Database Quotas
Get-MailboxDatabase | ft name,ProhibitSendReceiveQuota,ProhibitSendQuota, RecoverableItemsQuota,RecoverableItemsWarningquota,IssueWarningQuota -auto

Set Database Quotas
Set-MailboxDatabase -identity EX10mbx47 -ProhibitSendReceiveQuota 2.3GB -ProhibitSendQuota 2GB -IssueWarningQuota 1.899GB

Get WhiteSpace for database
Get-MailboxDatabase -identity EX10mbx08 -Status | Select Servername, Name, AvailableNewMailboxSpace

Get All Mailbox Sizes over 1GB in Database and sort them by size
Get-MailboxStatistics -Database ‘EX10mbx02’ | where {$_.Totalitemsize -gt 1GB} | Sort-Object -Property TotalItemSize -Descending | Format-Table DisplayName,TotalItemSize

Get Database Mounted Status
Get-MailboxDatabase -Status | Select Name, Server, Mounted

Get ALL Quotas for the Database
Get-MailboxDatabase -Identity “EX10mbx19” | fl *quota*

Export All Users in the database
Get-Mailbox -Database EX10mbx01 -ResultSize Unlimited > c:\dame\export.txt

Get all Exchange Database Sizes in DAG
Get-MailboxDatabase -Status | Sort-Object -Property DatabaseSize -descending | ft ServerName,Name,DatabaseSize -autosize

Get Single Database Size
Get-MailboxDatabase -identity EX10mbx02 -Status | ft ServerName,Name,DatabaseSize -autosize

Get All Users in specific Mailbox Database like 2003 View
Get-MailboxStatistics -Database “Mailbox Database” | Sort -Property TotalItemsize | Format-Table DisplayName, LastLoggedOnUserAccount, ItemCount, @{expression={$_.totalitemsize.value.ToMB()};label=”Size(MB)”}, LastLogonTime, LastLogoffTime

Status information for all copies of the database and details
Get-MailboxDatabaseCopyStatus -Identity ‘EX10mbx08’ | fl name, server, activationpreference,Status,CopyQueueLength,ContentIndexState,LatestFullBackupTime,ActiveCopy,ErrorEventID,errormessage

Get ALL MOUNTED Mailbox Databases and Find the Active Servers
Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus | ? {$_.ActiveCopy -eq $true} | sort name | ft mailboxserver,DatabaseName, Status,ContentIndexState -autosize

Status for all database copies on the Mailbox server EX1001
Get-MailboxDatabaseCopyStatus -Server EX1011 | fl DatabaseName, ContentIndexState, ActiveCopy, CopyQueueLength

Get All Database Copy
Get-MailboxDatabaseCopy

Get Deleted Item retention Stats
Get-mailboxdatabase | sort-object name | ft name,deleteditemretention -AutoSize



Categories: Exchange 2010, Exchange Server

Tags: , , , , , , , , ,

We look forward to hearing your feedback..

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: