System Center 2019+ Virtual Machine Manager WinRM-versie

Microsoft.SystemCenter.VirtualMachineManager.WinRMVersionMonitor (UnitMonitor)

Hiermee wordt gecontroleerd of de juiste versie van Windows Remote Management is geïnstalleerd.

Knowledge Base article:

Samenvatting

De versie van WinRM op de virtuele machine is incompatibel met de huidige versie van System Center Virtual Machine Manager (VMM).

Oorzaken

Virtual Machine Manager is bijgewerkt, waardoor WinRM eveneens moet worden bijgewerkt op de host.

Oplossingen

Werk WinRM op de host bij naar versie 6.0.6001.18000 of nieuwer.

Element properties:

TargetMicrosoft.SystemCenter.VirtualMachineManager.Discovery.HyperVHost
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SystemCenter.VirtualMachineManager.TimedPowershell.TwoStatesMonitorType
RemotableTrue
AccessibilityPublic
Alert Message
Onjuiste versie van WinRM geïnstalleerd
Een onjuiste versie van Windows Remote Management is geïnstalleerd op een computer. Computernaam: {0}
RunAsDefault

Source Code:

<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><Script># 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;</Script></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>