AKN424978

Monitor_AKN424978 (UnitMonitor)

Install Hotfix 2497453

Knowledge Base article:

External

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

Element properties:

TargetMicrosoft.KnowledgeServices.Exchange.2010.MailboxRole
Parent MonitorSystem.Health.ConfigurationState
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityInformation
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.KnowledgeServices.Library.PowerShellMonitorEx
RemotableTrue
AccessibilityPublic
Alert Message
Install Hotfix 2497453
<Details>
<Content>This is a recommended hotfix for Exchange 2010 Mailbox servers with a public folder store. For more information, see the KB article.</Content>
<CollectedInformation>
<Info>
<Name>OS Version</Name>
<Value>{0}</Value>
</Info>
<Info>
<Name>Exchange Version</Name>
<Value>{1}</Value>
</Info>
<Info>
<Name>.NET2 System.dll version</Name>
<Value>{2}</Value>
</Info>
</CollectedInformation>
</Details>
RunAsDefault
CommentSupportTopic=TBD;VersionNumber=1.0.0.0;

Source Code:

<UnitMonitor ID="Monitor_AKN424978" Comment="SupportTopic=TBD;VersionNumber=1.0.0.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="MonitorMessagef614bda04ba74dbf835bf26a6c26d91d">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Information</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='OSVersionOutput']$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='ExchangeVersionOutput']$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='SysDllVersionOutput']$</AlertParameter3>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>AKN424978.ps1</ScriptName>
<Parameters>
<Parameter>
<Name>ServerNameInput</Name>
<Value>$Target/Property[Type="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.MailboxRole"]/Name$</Value>
</Parameter>
<Parameter>
<Name>OSVersionInput</Name>
<Value>$Target/Host/Host/Property[Type="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.Installation"]/OSVersion$</Value>
</Parameter>
</Parameters>
<ScriptBody><Script>


param($ServerNameInput,$OSVersionInput)

$ErrorActionPreference = "Stop"

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

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

# Environment

$scriptenv = new-object System.Management.Automation.PSObject
$scriptenv | add-member NoteProperty "RuntimeError" $false
$scriptenv | add-member NoteProperty "SysDllFileVersionEnv" ""
$scriptenv | add-member NoteProperty "ExchangeVersionEnv" ""
$scriptenv | add-member NoteProperty "IsExchange2010SP1OrHigherEnv" $false
$scriptenv | add-member NoteProperty "HasMailboxRoleEnv" $false
$scriptenv | add-member NoteProperty "HasPublicFolderStoreEnv" $false
$scriptenv | add-member ScriptProperty "EarlierThanServer2012Env" {return ([version]$scriptargs.OSVersionInput).Major -eq 6 -and ([version]$scriptargs.OSVersionInput).Minor -lt 2}
$scriptenv | add-member ScriptProperty "DisableAvailabilityServiceCallsEnv" {return (Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\services\MSExchangeRPC").DisableAvailabilityServiceCalls}


#Get system.dll file version
Function Get-SysDllFileVersion
{
$sysDllPath = Join-Path $Env:SystemRoot "Microsoft.NET\Framework64\v2.0.50727\System.dll"

if(Test-Path $sysDllPath)
{
$sysDllfile = Get-Item $sysDllPath
$scriptenv.SysDllFileVersionEnv = "{0}.{1}.{2}.{3}" -f $sysDllfile.VersionInfo.FileMajorPart,$sysDllfile.VersionInfo.FileMinorPart,$sysDllfile.VersionInfo.FileBuildPart,$sysDllfile.VersionInfo.FilePrivatePart
}
}

Function Get-ExchangeServerInfo
{
if($scriptargs.ServerNameInput)
{
$exchangeServer = Get-ExchangeServer -Identity $scriptargs.ServerNameInput -ErrorAction SilentlyContinue
[array]$publicFolderDatabase = Get-PublicFolderDatabase -Server $scriptargs.ServerNameInput -ErrorAction SilentlyContinue

if($exchangeServer -and $publicFolderDatabase)
{
#Exchange version list: http://social.technet.microsoft.com/wiki/contents/articles/240.exchange-server-and-update-rollups-build-numbers.aspx
$scriptenv.ExchangeVersionEnv = "{0}.{1}.{2}.{3}" -f $exchangeServer.AdminDisplayVersion.Major,$exchangeServer.AdminDisplayVersion.Minor,$exchangeServer.AdminDisplayVersion.Build,$exchangeServer.AdminDisplayVersion.Revision
$scriptenv.IsExchange2010SP1OrHigherEnv = ($exchangeServer.AdminDisplayVersion.Major -eq 14 -and $exchangeServer.AdminDisplayVersion.Minor -ge 1)
$scriptenv.HasMailboxRoleEnv = $exchangeServer.IsMailboxServer
$scriptenv.HasPublicFolderStoreEnv = ($publicFolderDatabase.Count -gt 0)
}
}
}

# 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.
trap [Exception] {
$scriptenv.RuntimeError = $true
continue
}

# Initialize parameters
$scriptoutput.HasIssue = $false
$scriptoutput.OSVersionOutput = ""
$scriptoutput.ExchangeVersionOutput = ""
$scriptoutput.SysDllVersionOutput = ""

# Set parameter values
Get-SysDllFileVersion
Get-ExchangeServerInfo

# Detection Logic
If ($scriptenv.IsExchange2010SP1OrHigherEnv -and `
$scriptenv.HasMailboxRoleEnv -and `
$scriptenv.HasPublicFolderStoreEnv -and `
$scriptenv.EarlierThanServer2012Env -and `
-not ($scriptenv.DisableAvailabilityServiceCallsEnv -is [int] -and `
$scriptenv.DisableAvailabilityServiceCallsEnv -eq 1))
{
if(((([version]$scriptargs.OSVersionInput).Build -eq 7601 -or `
([version]$scriptargs.OSVersionInput).Build -eq 6002) -and `
([version]$scriptenv.SysDllFileVersionEnv) -lt [version]"2.0.50727.5660") -or `
(([version]$scriptargs.OSVersionInput).Build -eq 7600 -and `
[Version]$scriptenv.SysDllFileVersionEnv -lt [version]"2.0.50727.5662"))
{
if($scriptenv.RuntimeError -eq $false)
{
#Raise alert
$scriptoutput.HasIssue = $true
$scriptoutput.OSVersionOutput = $scriptargs.OSVersionInput
$scriptoutput.ExchangeVersionOutput = $scriptenv.ExchangeVersionEnv
$scriptoutput.SysDllVersionOutput = $scriptenv.SysDllFileVersionEnv
}
}
}
}
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.OSVersionOutput -ne $null)
{
$bag.AddValue("OSVersionOutput", $scriptoutput.OSVersionOutput)
}

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

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

$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>