AKN641054

Monitor_AKN641054 (UnitMonitor)

Missing Operating System Update KB2905412 may cause Stop error 0xD1 in a Windows Server-based computer that has multiple processors

Knowledge Base article:

External

http://go.microsoft.com/fwlink/?linkid=392632

Element properties:

TargetMicrosoft.KnowledgeServices.Windows.OperatingSystem
Parent MonitorSystem.Health.ConfigurationState
CategoryAlert
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.KnowledgeServices.Library.PowerShellMonitorEx
RemotableTrue
AccessibilityPublic
Alert Message
Missing Operating System Update KB2905412 may cause Stop error 0xD1 in a Windows Server-based computer that has multiple processors
<Details>
<Content>System Center Advisor detects that multiple processors exist in this Windows Server-based computer. This may cause computers to crash with stop error 0xD1. Apply hotfix 2905412 to stop computers going crash. See the following Knowledge Base article for more information.</Content>
<CollectedInformation />
</Details>
RunAsDefault
CommentSupportTopic=TBD;VersionNumber=1.0.0.0;

Source Code:

<UnitMonitor ID="Monitor_AKN641054" Comment="SupportTopic=TBD;VersionNumber=1.0.0.0;" Accessibility="Public" Enabled="true" Target="MicrosoftKnowledgeServicesWindowsLibrary!Microsoft.KnowledgeServices.Windows.OperatingSystem" ParentMonitorID="Health!System.Health.ConfigurationState" Remotable="true" Priority="Normal" TypeID="KnowledgeServicesLibrary!Microsoft.KnowledgeServices.Library.PowerShellMonitorEx" ConfirmDelivery="true">
<Category>Alert</Category>
<AlertSettings AlertMessage="MonitorMessagec5a4b90e2b7d4e918900b50b17a17391">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>AKN641054.ps1</ScriptName>
<Parameters>
<Parameter>
<Name>StrOSVersion</Name>
<Value>$Target/Property[Type="Windows!Microsoft.Windows.OperatingSystem"]/OSVersion$</Value>
</Parameter>
</Parameters>
<ScriptBody><Script>


param($StrOSVersion)

$ErrorActionPreference = "Stop"

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

# Set up the output
$global:scriptoutput = new-object psobject
$scriptoutput | add-member NoteProperty "HasIssue" $false
# Private function, please use CheckFilesIsInstalled instead.
function CheckFileInstalled([String]$KbID, [String]$RequiredFileLocation, [Version]$RequiredVersion, [bool]$Required, [bool]$ForceFileComparation)
{
if(([String]::IsNullOrEmpty($KbID)) -or ([String]::IsNullOrEmpty($RequiredFileLocation)) -or ($RequiredVersion -eq $null))
{
return $true
}

if((test-path $RequiredFileLocation))
{
$FileVersionInfo = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($RequiredFileLocation)
$CurrentFileVersion = "{0}.{1}.{2}.{3}" -f $FileVersionInfo.FileMajorPart,$FileVersionInfo.FileMinorPart,$FileVersionInfo.FileBuildPart,$FileVersionInfo.FilePrivatePart
$RequiredVersionPart = "{0}.{1}.{2}" -f $RequiredVersion.Major,$RequiredVersion.Minor,$RequiredVersion.Build

if($CurrentFileVersion.ToString().StartsWith($RequiredVersionPart))
{
if(($FileVersionInfo.FileMajorPart -ge 6) -and ($FileVersionInfo.FileBuildPart -ge 6000))
{
# Check if the current file version is GDR or LDR:
# http://blogs.technet.com/b/joscon/archive/2011/11/30/how-does-windows-choose-which-version-of-a-file-to-install.aspx
if(-not $ForceFileComparation -and (($FileVersionInfo.FilePrivatePart.ToString("d4").StartsWith(2) -and $RequiredVersion.Revision.ToString("d4").StartsWith(1)) -or `
($FileVersionInfo.FilePrivatePart.ToString("d4").StartsWith(1) -and $RequiredVersion.Revision.ToString("d4").StartsWith(2))))
{
return $true
}
}
}
return [Version]$CurrentFileVersion -ge $RequiredVersion
}

return -not $Required
}

function CheckFilesIsInstalled($fileInfos)
{
&lt;#
.DESCRIPTION
Check specified files are installed or not
.EXAMPLE
PS: CheckFilesIsInstalled $fileInfos
#&gt;

$array = @()

foreach($fileInfo in $fileInfos)
{
if(($fileInfo -ne $null) -and (-not (CheckFileInstalled $fileInfo.KbID $fileInfo.RequiredFileLocation $fileInfo.RequiredVersion $fileInfo.Required $fileInfo.ForceFileComparation)))
{
if((test-path $fileInfo.RequiredFileLocation))
{
$FileVersionInfo = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($fileInfo.RequiredFileLocation)
$CurrentFileVersion = "{0}.{1}.{2}.{3}" -f $FileVersionInfo.FileMajorPart,$FileVersionInfo.FileMinorPart,$FileVersionInfo.FileBuildPart,$FileVersionInfo.FilePrivatePart
$fileInfo.CurrentVersion = [Version]$CurrentFileVersion
}
else
{
$fileInfo.CurrentVersion = [Version]"0.0.0.0"
}
$array += $fileInfo
}
}
return $array
}

$hotfixInfoType = [System.Type] "PSObject"
$hotfixInfoListType = [System.Collections.Generic.List``1]
$hotfixInfoList = $hotfixInfoListType.MakeGenericType(@($hotfixInfoType))
$checkedFiles = [Activator]::CreateInstance($hotfixInfoList)

function CreateHotfixInfo([String]$KbID, [String]$RequiredFileLocation, [Version]$RequiredVersion, [bool]$Required, [bool]$ForceFileComparation=$false)
{
&lt;#
.DESCRIPTION
Create Hotfix
.EXAMPLE
PS: CreateHotfixInfo -KbID "KB2876391" -RequiredFileLocation "C:\Windows\System32\drivers\Mpio.sys" -RequiredVersion "6.1.7601.18251" -Required $true
#&gt;

if(([String]::IsNullOrEmpty($KbID)) -or ([String]::IsNullOrEmpty($RequiredFileLocation)) -or ($RequiredVersion -eq $null))
{
return $null
}

return $(New-Object PSObject -Property @{"KbID"=$KbID; "RequiredFileLocation"=$RequiredFileLocation; "RequiredVersion"=$RequiredVersion; "CurrentVersion"=[Version]"0.0.0.0"; "Required"=$Required; "ForceFileComparation"=$ForceFileComparation})
}
#-----------------------------------------------------
# MAIN CODE SECTION
#-----------------------------------------------------

# Environment
$scriptenv = New-Object System.Management.Automation.PSObject
$scriptenv | Add-Member NoteProperty "RuntimeError" $false
$scriptenv | Add-Member ScriptProperty "IsMultipleProcessorsEnv" {$processors = Get-WmiObject Win32_Processor; if($processors){return $processors.NumberOfLogicalProcessors -gt 1}}
$scriptenv | Add-Member ScriptProperty "IsWindowsServer2008R2Env" {([version]$scriptargs.StrOSVersion).Major -eq 6 -and ([version]$scriptargs.StrOSVersion).Minor -eq 1}
$scriptenv | Add-Member ScriptProperty "IsWindowsServer2012Env" {([version]$scriptargs.StrOSVersion).Major -eq 6 -and ([version]$scriptargs.StrOSVersion).Minor -eq 2}
#$scriptenv | Add-Member ScriptProperty "IsWindowsServer2012R2Env" {([version]$scriptargs.StrOSVersion).Major -eq 6 -and ([version]$scriptargs.StrOSVersion).Minor -eq 3}

# $checkedFiles variable and CreateHotfixInfo function are defined in the Common\Library\CommonRuleLibrary.ps1
$tcpip_filepath = Join-Path $Env:windir "system32\drivers\Tcpip.sys"
if($scriptenv.IsWindowsServer2008R2Env)
{
$checkedFiles.Add($(CreateHotfixInfo -KbID "KB2905412" -RequiredFileLocation $tcpip_filepath -RequiredVersion "6.1.7601.22502" -Required $true -ForceFileComparation $true))
}
if($scriptenv.IsWindowsServer2012Env)
{
$checkedFiles.Add($(CreateHotfixInfo -KbID "KB2905412" -RequiredFileLocation $tcpip_filepath -RequiredVersion "6.2.9200.20881" -Required $true -ForceFileComparation $true))
}

$filesNotApplied = @(CheckFilesIsInstalled($checkedFiles))

# Main function

function AdvisorRule($scriptargs, $scriptoutput)
{
trap [Exception] {
$scriptenv.RuntimeError = $true
continue
}

# Initialize parameters
$scriptoutput.HasIssue = $false

# Set parameter values
#if((($scriptenv.IsWindowsServer2008R22012Env -and $scriptenv.NoHotfix2905412Env) `
#-or ($scriptenv.IsWindowsServer2012R2Env -and $scriptenv.NoHotfix2896146Env)) -and `
if(($scriptenv.IsWindowsServer2008R2Env -or $scriptenv.IsWindowsServer2012Env) -and ($filesNotApplied.Count -gt 0) -and $scriptenv.IsMultipleProcessorsEnv -and -not $scriptenv.RuntimeError)
{
$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>86393</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>