Monthly Archive

Categories

Mailbox database status

 

A recent forum post on mailbox database status in Exchange 2007  proved interesting.

If I do this

PS> Get-MailboxDatabase -Status | select Name, server, storagegroup, mounted

Name Server StorageGroup
---- ------ ------------
MailDatabase EXCH07 EXCH07\Test1
MDB01 EXCH07 EXCH07\SG1
MDB02 EXCH071 EXCH071\SG2

but if I do this

PS> Get-MailboxDatabase -Status | select Name, server, storagegroup, mounted | fl *

Name : MailDatabase
Server : EXCH07
StorageGroup : EXCH07\Test1
Mounted : True

I get the mounted property. The help file says you have to use the format cmdlets to see the results of the status property

So if you want to work with the Mounted property  (or the BackupInProgress or OnlineMaintenanceInProgress properties)

You need to do something like this

Get-MailboxDatabase -Status | foreach {
$status = $_ | select -ExpandProperty Mounted
if ($status) {Write-Host "$($_.Identity) is Mounted"}
else {Write-Host "$($_.Identity) is not Mounted"}

}

The value is only visible if you use the –status switch AND you have to either use the format cmdlets or   seelct -expandproperty to be able to work with the property.

Awkward but usable.

Leave a Reply