Hiermee wordt gecontroleerd of de juiste versie van Windows Remote Management is geïnstalleerd.
De versie van WinRM op de virtuele machine is incompatibel met de huidige versie van System Center Virtual Machine Manager (VMM).
Virtual Machine Manager is bijgewerkt, waardoor WinRM eveneens moet worden bijgewerkt op de host.
Werk WinRM op de host bij naar versie 6.0.6001.18000 of nieuwer.
Target | Microsoft.SystemCenter.VirtualMachineManager.Discovery.HyperVHost | ||
Parent Monitor | System.Health.AvailabilityState | ||
Category | AvailabilityHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Error | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SystemCenter.VirtualMachineManager.TimedPowershell.TwoStatesMonitorType | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Microsoft.SystemCenter.VirtualMachineManager.WinRMVersionMonitor" Accessibility="Public" Target="VMMDiscovery!Microsoft.SystemCenter.VirtualMachineManager.Discovery.HyperVHost" ParentMonitorID="SystemHealth!System.Health.AvailabilityState" Remotable="true" TypeID="Microsoft.SystemCenter.VirtualMachineManager.TimedPowershell.TwoStatesMonitorType">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Microsoft.SystemCenter.VirtualMachineManager.WinRMVersionMonitor.AlertMessage">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Error</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</AlertParameter1>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="InCorrectVersionWinRMInstalled" MonitorTypeStateID="Error" HealthState="Error"/>
<OperationalState ID="CorrectVersionWinRMInstalled" MonitorTypeStateID="Success" HealthState="Success"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>7200</IntervalSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<ScriptName>CheckWinRMVersionMonitorScript.ps1</ScriptName>
<ScriptBody> # Copyright (c) Microsoft Corporation. All rights reserved.
# Powershell source code
# CheckWinRMVersionMonitorScript.ps1
# This Script is used to get the version of %Windir%\System32\wsmsvc.dll
# If the version is greater than "6.0.6001.18000",
# then it returns "Healthy", otherwise returns "Unhealthy"
$momAPI = new-object -comObject MOM.ScriptAPI
$error.Clear();
$oBag = $momAPI.CreatePropertyBag();
$dll = Get-Item $env:windir\System32\wsmsvc.dll
if($dll -ne $null){
# Check that version is 5.x.x.x (WS 2003) or less than 6.0.6001.18000
if(($dll.VersionInfo.ProductMajorPart -lt 6) -or (($dll.VersionInfo.ProductMajorPart -eq 6) -and ($dll.VersionInfo.ProductMinorPart -eq 0) -and (($dll.VersionInfo.ProductBuildPart -lt 6001) -or (($dll.ProductBuildPart -eq 6001) -and ($dll.VersionInfo.ProductPrivatePart -le 18000)))))
{
$oBag.AddValue("Correct Version WinRM Installed", "UnHealthy");
}
else
{
$oBag.AddValue("Correct Version WinRM Installed", "Healthy");
}
}
else {
$oBag.AddValue("Correct Version WinRM Installed", "UnHealthy");
}
$oBag; </ScriptBody>
<Parameters/>
<ErrorExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='Correct Version WinRM Installed']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">UnHealthy</Value>
</ValueExpression>
</SimpleExpression>
</ErrorExpression>
<SuccessExpression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='Correct Version WinRM Installed']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">Healthy</Value>
</ValueExpression>
</SimpleExpression>
</SuccessExpression>
</Configuration>
</UnitMonitor>