AKN384766

Monitor_AKN384766 (UnitMonitor)

Exchange 2010 earlier than SP3 is not supported in Windows Server 2012

Knowledge Base article:

External

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

Element properties:

TargetMicrosoft.KnowledgeServices.Exchange.2010.Installation
Parent MonitorSystem.Health.ConfigurationState
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityHigh
Alert Auto ResolveTrue
Monitor TypeMicrosoft.KnowledgeServices.Library.PowerShellMonitorEx
RemotableTrue
AccessibilityPublic
Alert Message
Exchange 2010 earlier than SP3 is not supported in Windows Server 2012
<Details>
<Content>Microsoft Exchange 2010 earlier than Service Pack 3 (SP3) is not supported in Windows Server 2012. See the article for more information.</Content>
<CollectedInformation />
</Details>
RunAsDefault
CommentSupportTopic=TBD;VersionNumber=1.0.0.0;

Source Code:

<UnitMonitor ID="Monitor_AKN384766" Comment="SupportTopic=TBD;VersionNumber=1.0.0.0;" Accessibility="Public" Enabled="true" Target="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.Installation" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="High" TypeID="KnowledgeServicesLibrary!Microsoft.KnowledgeServices.Library.PowerShellMonitorEx" ConfirmDelivery="true">
<Category>Alert</Category>
<AlertSettings AlertMessage="MonitorMessageb5d5b0a0cbc34b9b95f8ca29d5374b68">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>High</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>AKN384766.ps1</ScriptName>
<Parameters>
<Parameter>
<Name>StrOSVersion</Name>
<Value>$Target/Property[Type="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.Installation"]/OSVersion$</Value>
</Parameter>
<Parameter>
<Name>ExchangeMajorVersion</Name>
<Value>$Target/Property[Type="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.Installation"]/SetupProductMajor$</Value>
</Parameter>
<Parameter>
<Name>ExchangeMinorVersion</Name>
<Value>$Target/Property[Type="MicrosoftKnowledgeServicesExchange2010Library!Microsoft.KnowledgeServices.Exchange.2010.Installation"]/SetupProductMinor$</Value>
</Parameter>
</Parameters>
<ScriptBody><Script>


param($StrOSVersion,$ExchangeMajorVersion,$ExchangeMinorVersion)

$ErrorActionPreference = "Stop"

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

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

# Environment
$scriptenv = New-Object PSObject
$scriptenv | Add-Member NoteProperty "ErrorFlag" $false
$scriptenv | Add-Member NoteProperty "ExchVersion" 0
$scriptenv | Add-Member NoteProperty "IsExchangeRTMOrSP1" $false
$scriptenv | Add-Member ScriptProperty "IsWindowsServer2012Env" {([version]$scriptargs.StrOSVersion).Major -eq 6 -and ([version]$scriptargs.StrOSVersion).Minor -eq 2}

# Function to check is Exchange Server 2010 RTM or SP1 Environment
Function Check-IsExchangeRTMOrSP1()
{
if(Test-Path "HKLM:SOFTWARE\Microsoft\ExchangeServer\v14\Setup")
{
$scriptenv.ExchVersion = 14
}
if(Test-Path "HKLM:SOFTWARE\Microsoft\ExchangeServer\v15\Setup")
{
$scriptenv.ExchVersion = 15
}

if(($scriptenv.ExchVersion -eq 14) -and ($scriptargs.ExchangeMajorVersion -eq 14 -and $scriptargs.ExchangeMinorVersion -le 2))
{
$scriptenv.IsExchangeRTMOrSP1 = $true
}
}

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

Trap [Exception] {
$scriptenv.ErrorFlag = $true
Continue
}

# Initialize parameters
$scriptoutput.HasIssue = $false

# Detection Logic
if($scriptenv.IsWindowsServer2012Env)
{
Check-IsExchangeRTMOrSP1
if($scriptenv.IsExchangeRTMOrSP1 -and $scriptenv.ErrorFlag -ne $true)
{
$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)
}

$bag

</Script></ScriptBody>
<SnapIns/>
<TimeoutSeconds>300</TimeoutSeconds>
<Schedule>86380</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>