AK545962

Monitor_AK545962 (UnitMonitor)

The System Attendant homeMDB attribute is missing or invalid

Knowledge Base article:

External

http://go.microsoft.com/fwlink/?LinkId=228762

Element properties:

TargetMicrosoft.KnowledgeServices.Exchange.2010.MailboxRole
Parent MonitorSystem.Health.ConfigurationState
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.KnowledgeServices.Library.PowerShellMonitorEx
RemotableTrue
AccessibilityPublic
Alert Message
The System Attendant homeMDB attribute is Missing or invalid
<Details>
<Content>If the System Attendant homeMDB value is missing or not valid, you may experience the following symptoms in your Exchange environment:
- Move Mailbox to or from this server fails with error "hr=0x80040111" "ec=1010".
- Users are unable to retrieve the free/busy information for Exchange users.
- Search Indexing fails with a "MapiExceptionUnknownUser" error.

To address this issue, use the ADSI Edit tool to determine the distinguished name of the appropriate mailbox database, and then set the System Attendant homeMDB attribute. See the Knowledge Base article for more information.</Content>
<CollectedInformation>
<Info>
<Name>Mailbox Server</Name>
<Value>{0}</Value>
</Info>
<Info>
<Name>System Attendant homeMdb DN</Name>
<Value>{1}</Value>
</Info>
</CollectedInformation>
</Details>
RunAsDefault
CommentSupportTopic=TBD;VersionNumber=1.0.1.0;

Source Code:

<UnitMonitor ID="Monitor_AK545962" Comment="SupportTopic=TBD;VersionNumber=1.0.1.0;" Accessibility="Public" Enabled="true" Target="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.MailboxRole" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="KnowledgeServicesLibrary!Microsoft.KnowledgeServices.Library.PowerShellMonitorEx" ConfirmDelivery="true">
<Category>Alert</Category>
<AlertSettings AlertMessage="MonitorMessage631dda986b714b0a885b31152e402342">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.MailboxRole"]/Name$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='SystemAttendantHomeMdbDN']$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>AK545962.ps1</ScriptName>
<Parameters>
<Parameter>
<Name>MailboxServerName</Name>
<Value>$Target/Property[Type="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.MailboxRole"]/Name$</Value>
</Parameter>
</Parameters>
<ScriptBody><Script>


param($MailboxServerName)

$ErrorActionPreference = "Stop"

# Set up the arguments
$scriptargs = new-object psobject
$scriptargs | add-member NoteProperty "MailboxServerName" $MailboxServerName

# Set up the output
$global:scriptoutput = new-object psobject
$scriptoutput | add-member NoteProperty "HasIssue" $false
$scriptoutput | add-member NoteProperty "SystemAttendantHomeMdbDN" ""
#-----------------------------------------------------
# MAIN CODE SECTION
#-----------------------------------------------------

# Environment

$scriptenv = new-object psobject
$scriptenv | add-member NoteProperty "MailboxServer" $null
$scriptenv | add-member NoteProperty "ServerDistinguishedName" ""
$scriptenv | add-member NoteProperty "ADSIPath" ""
$scriptenv | add-member NoteProperty "HomeMdbAttribute" "null"
$scriptenv | add-member NoteProperty "HomeMdbAttributeValue" "null"
$scriptenv | add-member NoteProperty "HomeMdb" $null


# Helper functions

#function to get the System Attendant homeMdb Attribute
Function Get-HomeMdbInfo{
Param ([string]$ServerName = $scriptargs.MailboxServerName)

$scriptenv.MailboxServer = Get-MailboxServer -Identity $ServerName -ErrorAction SilentlyContinue
If($scriptenv.MailboxServer -ne $null){
$scriptenv.ServerDistinguishedName = $scriptenv.MailboxServer.DistinguishedName
If($scriptenv.ServerDistinguishedName -ne "" -and $scriptenv.ServerDistinguishedName -ne $null){
$scriptenv.ADSIPath = "LDAP://CN=Microsoft System Attendant," + $scriptenv.ServerDistinguishedName
$scriptenv.HomeMdbAttribute = ([ADSI]$scriptenv.ADSIPath).Properties["homeMdb"][0]
If($scriptenv.HomeMdbAttribute -ne $null -and $scriptenv.HomeMdbAttribute -ne ""){
$scriptenv.HomeMdb = Get-MailboxDatabase -Identity $scriptenv.HomeMdbAttribute -ErrorAction SilentlyContinue
}
else{
$scriptenv.HomeMdbAttribute = "null"
}
}
}
}


# Main function

Function AdvisorRule($scriptargs, $scriptoutput)
{
# All parameters should be populated outside of the main function.
# The mian function should only include the detection logic so that it can be easyly reused by the Atlanta authoring tool.

# Initialize parameters
$scriptoutput.HasIssue = $false

# Set parameter values
Get-HomeMdbInfo
$scriptoutput.SystemAttendantHomeMdbDN = $scriptenv.HomeMdbAttribute

# Detection Logic
If ($scriptenv.HomeMdbAttribute -eq $null -or $scriptenv.HomeMdb -eq $null){
#Raise alert
$scriptoutput.HasIssue = $true
}
}
AdvisorRule $scriptargs $scriptoutput

# set the output
$mom = new-object -comobject "MOM.ScriptAPI"
$bag = $mom.CreatePropertyBag()

if ($scriptoutput.HasIssue -ne $null)
{
$bag.AddValue("HasIssue", $scriptoutput.HasIssue)
}

if ($scriptoutput.SystemAttendantHomeMdbDN -ne $null)
{
$bag.AddValue("SystemAttendantHomeMdbDN", $scriptoutput.SystemAttendantHomeMdbDN)
}

$bag

</Script></ScriptBody>
<SnapIns>
<SnapIn>Microsoft.Exchange.Management.PowerShell.E2010</SnapIn>
</SnapIns>
<TimeoutSeconds>300</TimeoutSeconds>
<Schedule>86372</Schedule>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='HasIssue']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<SuccessExpression>
<Not>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Boolean">Property[@Name='HasIssue']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="Boolean">true</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Not>
</SuccessExpression>
</Configuration>
</UnitMonitor>