AKN703341

Monitor_AKN703341 (UnitMonitor)

Hotfix 2585233 helps prevent Stop error 0x000000AB on a Windows Server 2008 R2-based terminal server

Knowledge Base article:

External

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

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
Hotfix 2585233 helps prevent Stop error 0x000000AB on a Windows Server 2008 R2-based terminal server
<Details>
<Content>System Center Advisor has detected that the Windows Server 2008 R2-based terminal server is in an unstable state and leaks memory. This might result in a 0x000000AB Stop error. To fix the issue, see the following Microsoft Knowledge Base (KB) article for more information.</Content>
<CollectedInformation>
<Info>
<Name>Current Win32k.sys file version</Name>
<Value>{0}</Value>
</Info>
</CollectedInformation>
</Details>
RunAsDefault
CommentSupportTopic=TBD;VersionNumber=1.0.0.0;

Source Code:

<UnitMonitor ID="Monitor_AKN703341" 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="MonitorMessageb409d1fbd911488d8fe107ceebf8a187">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/Property[@Name='CurrentFileVersion']$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="Success" HealthState="Success"/>
<OperationalState ID="Error" MonitorTypeStateID="Error" HealthState="Error"/>
</OperationalStates>
<Configuration>
<ScriptName>AKN703341.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
$scriptoutput | add-member NoteProperty "CurrentFileVersion" ""
# Environment
$scriptenv = New-Object psobject
$scriptenv | Add-Member NoteProperty "RuntimeError" $false
$scriptenv | Add-Member NoteProperty "IsTerminalServer" $false
$scriptenv | add-member NoteProperty "CurrentFileVersion" ""
$scriptenv | Add-Member NoteProperty "IsFileVersionLowerThanRequired" $false
$scriptenv | Add-Member ScriptProperty "IsWindowsServer2008R2Env" {([version]$scriptargs.StrOSVersion).Major -eq 6 -and ([version]$scriptargs.StrOSVersion).Minor -eq 1}

function Check-IsTerminalServer
{
#Role IDs described at http://msdn.microsoft.com/en-us/library/cc280268(VS.85).aspx
$getRDS = Get-WmiObject Win32_ServerFeature -Filter "(ID = 18)"

if($getRDS -ne $null)
{
$scriptenv.IsTerminalServer = $true
}
}

function Check-Win32kSysFileVersion
{
$systemdirectory = (Get-WmiObject Win32_OperatingSystem).SystemDirectory
$filepath = Join-Path $systemdirectory "Win32k.sys"

if ((Test-Path $filepath))
{
$filever = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($filepath);
$strversioninfo = "{0}.{1}.{2}.{3}" -f $fileVer.FileMajorPart, $fileVer.FileMinorPart, $fileVer.FileBuildPart, $fileVer.FilePrivatePart

$versioninfo = [Version]$strversioninfo;
$scriptenv.CurrentFileVersion = $strversioninfo

if ($versioninfo -lt [Version]"6.1.7601.21819")
{
$scriptenv.IsFileVersionLowerThanRequired = $true;
}
}
}

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

# Initialize parameters
$scriptoutput.HasIssue = $false

# Detection Logic
if($scriptenv.IsWindowsServer2008R2Env)
{
Check-IsTerminalServer
if($scriptenv.IsTerminalServer)
{
Check-Win32kSysFileVersion
if($scriptenv.IsFileVersionLowerThanRequired)
{
if ($scriptenv.RuntimeError -eq $false)
{
$scriptoutput.HasIssue = $true
$scriptoutput.CurrentFileVersion = $scriptenv.CurrentFileVersion
}
}
}
}
}
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.CurrentFileVersion -ne $null)
{
$bag.AddValue("CurrentFileVersion", $scriptoutput.CurrentFileVersion)
}

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