Thanks, yes in general this works, where can I find the other properties like number of missing patches? I tried the next step to run the script on a cluster and changed the entity to $cluster but ...
See more...
Thanks, yes in general this works, where can I find the other properties like number of missing patches? I tried the next step to run the script on a cluster and changed the entity to $cluster but got partially error: $cluster = Get-Cluster -Name vsan-cluster PS D:\VMware-HC\code> .\patch-compl-new.ps1 Get-Compliance : 07.10.2022 19:57:13 Get-Compliance fault.SecurityError.summary In D:\VMware-HC\code\patch-compl-new.ps1:1 Zeichen:1 + Get-Compliance -Entity vsan-cluster -Baseline $Baseline | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-Compliance], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VumAutomation.Commands.GetCompliance Get-Compliance : 07.10.2022 19:57:13 Get-Compliance fault.SecurityError.summary In D:\VMware-HC\code\patch-compl-new.ps1:1 Zeichen:1 + Get-Compliance -Entity vsan-cluster -Baseline $Baseline | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-Compliance], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VumAutomation.Commands.GetCompliance Get-Compliance : 07.10.2022 19:57:13 Get-Compliance fault.SecurityError.summary In D:\VMware-HC\code\patch-compl-new.ps1:1 Zeichen:1 + Get-Compliance -Entity vsan-cluster -Baseline $Baseline | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-Compliance], VimException + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VumAutomation.Commands.GetCompliance VMHost Status Baseline NumberofPatches ------ ------ -------- --------------- host06.sp.local Compliant Host Security Patches (Predefined) 138 host06.sp.local NotCompliant Critical Host Patches (Predefined) 196 host03.sp.local Compliant Host Security Patches (Predefined) 138 host03.sp.local NotCompliant Critical Host Patches (Predefined) 196 host04.sp.local Compliant Host Security Patches (Predefined) 138 host04.sp.local NotCompliant Critical Host Patches (Predefined) 196 host05.sp.local Compliant Host Security Patches (Predefined) 138 host05.sp.local NotCompliant Critical Host Patches (Predefined) 196 host02.sp.local Compliant Host Security Patches (Predefined) 138 host02.sp.local NotCompliant Critical Host Patches (Predefined) 196 host01.sp.local Compliant Host Security Patches (Predefined) 138 host01.sp.local NotCompliant Critical Host Patches (Predefined) 196