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

Re: Export Compliance Reports

$
0
0

Definitely digging your shortcut! I pretty much abandoned the original script. Here's is how I have been running my query:

 

$vmesxi = (Get-VMHost -Name (Get-Content "C:\esxihosts.txt"))
# Get today's date
$CurrentDate = Get-Date
$CurrentDate = $CurrentDate.ToString('MM-dd-yyyy_hhmmss')
# Set Output Path
$path = "C:\Reports\"
foreach ($i in $vmesxi) {  Get-Compliance -Entity $i -Detailed |       Select @{N="Host Name";E={$_.Entity.Name}},       @{N="Baseline";E={$_.Baseline.Name}},       @{N="Compliant Patches";E={$_.CompliantPatches | Measure-Object | Select -ExpandProperty Count}},       @{N="Not Compliant Patches";E={$_.NotCompliantPatches | Measure-Object | Select -ExpandProperty Count}},       @{N="Unknown Patches";E={$_.UnknownPatches | Measure-Object | Select -ExpandProperty Count}},       @{N="Not Applicable Patches";E={$_.NotApplicablePatches | Measure-Object | Select -ExpandProperty Count}},       Status |  Export-Csv "$path\PatchComplianceReport_$CurrentDate.csv" -UseCulture -NoTypeInformation  }

 

And there are two hostnames in the text file.


Viewing all articles
Browse latest Browse all 144140

Trending Articles



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