VMware Cloud Community
RvdNieuwendijk
Leadership
Leadership

Check for VUM baselines extension to the vCheck script

I made an extension to Alan Renouf's vCheck script to check for ESX servers that are not compliant with the VMware Update Manager attached baselines. Don’t forget to install the VMware vCenter Update Manager PowerCLI before you try my code. Enjoy!

# Hosts not compliant to VMware Update Manager Baselines
$ShowHostVUMNonCompliance = $true

# ---- Hosts VMware Update Manager Baseline non-compliance ----
If ($ShowHostVUMNonCompliance){
  Write-CustomOut "..Checking Hosts VMware Update Manager Baseline non-compliance"
  Add-PSSnapin -Name VMware.VumAutomation
  $NonCompliance = Get-VMHost | Sort-Object -Property Name | Get-Compliance | Where-Object {$_.Status -ne "Compliant"}
  If (($NonCompliance | Measure-Object).count -gt 0) {
    $MyReport += Get-CustomHeader "Hosts VMware Update Manager Baseline non-compliance : $($NonCompliance.count)" "The following hosts are not compliant to the attached baselines"
    $MyReport += Get-HTMLTable ($NonCompliance | Select-Object -Property @{N="Host";E={$_.Entity}},@{N="Baseline";E={$_.Baseline.Name}},Status)
    $MyReport += Get-CustomHeaderClose
  }
}

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
Reply
0 Kudos
0 Replies