VMware Cloud Community
falcalen
Contributor
Contributor
Jump to solution

Host Profile Audit Script

Is there a PS Script that generate report for host profiles? We have many host profile and we want to check what settings we made to each host profile and save it into a document. Could anyone please help? Thanks.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

None that I know off, but I usally start with the following to give me a quick report on a host profile's settings.

Note that some of these parameters are more complex than a simple scalar so they would need further code to report on the details.

&{foreach($prof in Get-VMHostProfile){
  foreach($expr in $prof.ExtensionData.Config.DefaultComplyProfile.Expression){
    $expr.Parameter |
    Select @{N="Host Profile";E={$prof.Name}},
      @{N="Expression";E={$expr.Id}},
     
@{N="Parameter";E={$_.Key}},
      @{N="Value";E={$_.Value}}   } }} | Export-Csv C:\hp-report.csv -NoTypeInformation -UseCulture


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

None that I know off, but I usally start with the following to give me a quick report on a host profile's settings.

Note that some of these parameters are more complex than a simple scalar so they would need further code to report on the details.

&{foreach($prof in Get-VMHostProfile){
  foreach($expr in $prof.ExtensionData.Config.DefaultComplyProfile.Expression){
    $expr.Parameter |
    Select @{N="Host Profile";E={$prof.Name}},
      @{N="Expression";E={$expr.Id}},
     
@{N="Parameter";E={$_.Key}},
      @{N="Value";E={$_.Value}}   } }} | Export-Csv C:\hp-report.csv -NoTypeInformation -UseCulture


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
falcalen
Contributor
Contributor
Jump to solution

Thanks LucD, just what I needed. 

0 Kudos