Version von System Center 2019+ Virtual Machine Manager-WinRM

Microsoft.SystemCenter.VirtualMachineManager.WinRMVersionMonitor (UnitMonitor)

Überwacht, ob die richtige Version der Windows-Remoteverwaltung installiert ist.

Knowledge Base article:

Zusammenfassung

Die Version von WinRM auf dem Host für virtuelle Maschinen ist nicht kompatibel mit der aktuellen Version von System Center Virtual Machine Manager (VMM).

Ursachen

Es wurde ein Virtual Machine Manager-Update ausgeführt, daher ist auch ein WinRM-Update auf dem Host erforderlich.

Lösungen

Führen Sie ein WinRM-Update auf dem Host auf 6.0.6001.18000 oder höher aus.

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
Falsche Version von WinRM ist installiert.
Auf einem Computer wurde eine falsche Version der Windows-Remoteverwaltung installiert. Computername: {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>