The System Attendant homeMDB attribute is missing or invalid
http://go.microsoft.com/fwlink/?LinkId=228762
Target | Microsoft.KnowledgeServices.Exchange.2010.MailboxRole | ||
Parent Monitor | System.Health.ConfigurationState | ||
Category | Alert | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.KnowledgeServices.Library.PowerShellMonitorEx | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default | ||
Comment | SupportTopic=TBD;VersionNumber=1.0.1.0; |
<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>
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
</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>