Exchange 2010 Database Status PowerShell CMDlets

Home/Exchange Server/Exchange 2010/Exchange 2010 Database Status PowerShell CMDlets

Exchange 2010 Database Status PowerShell CMDlets

Status for all database copies on the Mailbox server Ex10CHM10 by status
Get-MailboxDatabaseCopyStatus -Server Ex10CHM09 | Sort-Object -Property Status| ft mailboxserver,DatabaseName, status,Copyqueuelength,Replayqueuelength, ContentIndexState, ActiveCopy,ErrorMessage -AutoSize

Get Database Copy Status
Get-MailboxDatabaseCopyStatus -Identity ‘Ex10mbx12’ | ft name,Status,ContentIndexState,ReplayQueueLength,CopyQueueLength -autosize

Get High Copy Queue Length in Organization
get-mailboxserver | Get-MailboxDatabaseCopyStatus | sort-object -property copyqueuelength -des | ft name,Status,ContentIndexState,ReplayQueueLength,CopyQueueLength -autosize

Get Error Information for Seeding
Get-MailboxDatabaseCopyStatus -Identity ‘Ex10mbx11’ | fl name,Status,Errormessage

Get Quick Health Status of Copies in DAG
Get-DatabaseAvailabilityGroup Ex10DAG1 | %{ $_.Servers | %{ Get-MailboxDatabaseCopyStatus -Server $_ } }

Get all copies of Failed Databases in DAG
Get-mailboxserver | Get-MailboxDatabaseCopyStatus | where {$_.Status -eq “Failed*”} | Sort-Object -Property DatabaseName| ft DatabaseName, status,Copyqueuelength,Replayqueuelength, ContentIndexState, ActiveCopy -AutoSize

Get Mounted Databases in DAG and status
Get-mailboxserver | Get-MailboxDatabaseCopyStatus | where {$_.Status -eq “mounted” } | Sort-Object -Property DatabaseName| ft MailboxServer,status, ActiveCopy,DatabaseName, Copyqueuelength,Replayqueuelength, ContentIndexState -AutoSize

Status information for ALL Database copies in DAG sorted by Status
Get-mailboxserver | Get-MailboxDatabaseCopyStatus | Sort-Object -Property Status | ft name,Status,ContentIndexState,ReplayQueueLength,CopyQueueLength -autosize

Status information for ALL Database copies in DAG sorted by Copyqueuelength
Get-mailboxserver | Get-MailboxDatabaseCopyStatus | Sort-Object -Property copyqueuelength -descending | ft name,Status,ContentIndexState,ReplayQueueLength,CopyQueueLength -autosize

Get ALL non-healthy COPIES in DAG
Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus | where ({$_.Status -ne “healthy” -and $_.Status -ne “mounted” })| sort name |ft name, Status, LatestFullBackupTime, ActiveCopy -autosize

Get ALL database copies in DAG sorted by Content Index State
Get-mailboxserver | Get-MailboxDatabaseCopyStatus | Sort-Object -Property ContentIndexState | ft name,Status,ContentIndexState,ReplayQueueLength,CopyQueueLength -autosize

Get ALL database copies on a Server sorted by Database
Get-MailboxDatabaseCopyStatus -Server Ex10CHM11 |sort name | ft DatabaseName, status,Copyqueuelength,Replayqueuelength, ContentIndexState, ActiveCopy -AutoSize

Get Active Database Copies in DAG
Get-mailboxserver | Get-MailboxDatabaseCopyStatus |? {$_.ActiveCopy -eq $true} | Sort-Object -Property DatabaseName| ft DatabaseName, status,Copyqueuelength,Replayqueuelength, ContentIndexState, ActiveCopy -AutoSize

Status for all database copies on the Mailbox server Ex10CHM10 by name
Get-MailboxDatabaseCopyStatus -Server Ex10CHM07 | SORT NAME| ft mailboxserver,DatabaseName, status,Copyqueuelength,Replayqueuelength, ContentIndexState, ActiveCopy,ErrorMessage -AutoSize

Status for all database copies on the Mailbox server Ex10CHM10 (simple)
Get-MailboxDatabaseCopyStatus -Server Ex10CHM10 | Sort-Object -Property DatabaseName | ft DatabaseName, MailboxServer, Status -autosize

Get all copies of Failed Databases on Server
Get-MailboxDatabase -server Ex10CHM03| Get-MailboxDatabaseCopyStatus | where {$_.Status -eq “Failed”} | ft Databasename,status -autosize

Get Active Copies on Server
Get-MailboxDatabaseCopyStatus -Server Ex10CHM02 |? {$_.ActiveCopy -eq $true} | ft DatabaseName, status,Copyqueuelength,Replayqueuelength, ContentIndexState, ActiveCopy -AutoSize

Get ALL non-healthy Passive COPIES on a Server
Get-MailboxDatabaseCopyStatus -Server Ex10CHM11 | where ({$_.Status -ne “healthy” -and $_.Status -ne “mounted” })| sort name |ft name, Status, LatestFullBackupTime, ActiveCopy -autosize

Get status for all copies of a particular database Ex10mbx01
Get-MailboxDatabaseCopyStatus -Identity ‘Ex10mbx01’ | ft name,Status,ContentIndexState,ReplayQueueLength,CopyQueueLength -autosize

Get Status for all database copies on the Mailbox server Ex10CHM01 (extensive details)
Get-MailboxDatabaseCopyStatus -Server Ex10CHM03 | fl DatabaseName, Status, ActiveDatabaseCopy, ActivationSuspended, ContentIndexState, ContentIndexErrorMessage, ReplayQueueLength, LastCopiedLogTime, ErrorMessage

Get Database and Log Paths
Get-MailboxDatabase Ex10mbx06 | fl *path*

Find Database Log file location
Get-MailboxDatabase Ex10mbx06 | fl logfolderpath

See if Circular Enabled is enabled
Get-MailboxDatabase -Identity Ex10mbx01 | fl Name, CircularLoggingEnabled

Check the Mount Status of a Mailbox Database
Get-MailboxDatabase -Status | Select Name, Server, Mounted

Dismount a Mailbox Database
Dismount-Database “Ex10mbx19”

Get Local Database Status
Get-MailboxDatabaseCopyStatus -Local | fl DatabaseName, ContentIndexState, Status,CopyQueueLength,ContentIndexState,LatestFullBackupTime,ActiveCopy,ErrorEventID,errormessage

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

Status information for all copies of the databases in DAG and details
Get-MailboxDatabase | Get-MailboxDatabaseCopyStatus | where {$_.Status -ne $healthy}| fl name, server, Status, CopyQueueLength, ContentIndexState, LatestFullBackupTime, ActiveCopy,ErrorEventID,errormessage

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

Get All Database Copy
Get-MailboxDatabaseCopy

Move Database Path
Move-DatabasePath -Identity Ex10mbx19 -EdbFilePath E:dbEx10mbx19.edb

Block all databases hosted on a server from Activating
Set-MailboxServer –identity Ex10CHM13 –DatabaseCopyAutoActivationPolicy Blocked

Test-ReplicationHealth cmdlet to test the health of replication for the Mailbox server Ex10CHM01
Test-ReplicationHealth -Identity Ex10CHM01

Please feel free to share.
By | 2013-07-08T14:26:03+00:00 July 8th, 2013|Exchange 2010, Exchange Server|1 Comment

About the Author:

One Comment

  1. Sach June 25, 2014 at 11:23 pm - Reply

    excellent collection of cmdlets

Leave A Comment