Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 246801

Re: Check Host Profile Compliance At Host Level

$
0
0

Thanks! I made a few additions to the sample which will also check if no profile is attached:

 

foreach

($VMHostin (Get-VMHost)) {

 

$Compliance=Test-VMHostProfileCompliance-VMHost$VMHost-UseCache

$AttachedProfile=Get-VMHostProfile-entity$VMHost

 

if ($Compliance-ne$null)

     {

     $ComplianceStatus=$Compliance.ExtensionData.ComplianceStatus

     }

elseif ($AttachedProfile-eq$null)

     {

     $ComplianceStatus="No Profile Attached!"

     }

else

     {

     $ComplianceStatus="Compliant"

     }

New-Object-TypeNamePSObject-Property @{

VMhost

=$VMHost.name

ComplianceStatus

=$ComplianceStatus

}

}

 

 

 

 

 

 

 

 

 

 

 

 


Viewing all articles
Browse latest Browse all 246801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>