VMware Cloud Community
Mad_Dog2727
Contributor
Contributor

Get-VMhostAdvancedConfiguration & ESXi Hosts

:smileyconfused:

I have 13 ESXi hosts across multiple domains and security boundaries and therefore can only access each ESXi host individually.

Initially all 13 ESXi hosts should have been built to a uniform baseline.  Subsequent to the baseline build completion, specific domain and site specific configuration changes are made although these are high level and minimal (IP address FQDN etc.)

Troubleshooting a couple of recent issues has highlighted discrepancies on a number of host's baseline build configurations which has resulted in the requirement to compare each and every ESXi host's configuration.

I looking to run a VMware PowerCLI command on each host and have the output exported to a .CSV file so that I can then complete a QA check on the each hosts baseline build configuration against the baseline build document.  I want to output to a CSV file the entire ESXi host configuration which needs to includes the details displayed in both the Summary Tab and the Configuration Tab of the selected ESXI host within the vSphere Client (i.e.:- Hardware-Processors, Memory, Storage etc. , Software- License, Time, DNS, Routing etc., General, Resources, Storage, Network, Fault Tolerance etc.)

I believe the correct cmdlet is Get-VMHostAdvanceConfiguration? 

I can run this command successfully with the output to the screen however when I then try to  export the same content to a .csv file it fails.

Any help or advice would be greatly appreciated.  I have spend some considerable time searching the web but have not found any answers specific to my requirement.

6 Replies
LucD
Leadership
Leadership

I would use the Get-AdvancedSetting cmdlet instead.

How did you try to export that data to a CSV file ?

Can yu show your code ?


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

0Walt0
Contributor
Contributor

I agree with you, Get-AdvancedSetting, along with New-*, Set-* and Remove-*, makes great for automating this and further tedious tasks.

This not only works for ESX(i) host, but for any VM and is how I got my Hyper-V boxes to run.

Mad_Dog2727
Contributor
Contributor

Hello LucD Connect_VIServer Followed by Get-VMHostAdvanceConfiguration This gave me 923 lines of data on the screen.  I then tried to export the same output to a .CSV file:_ Get-VMHostAdvanceConfiguration | Export-CSV No errors were returned to the screen and unfortunately the filename.csv file contain 1 kb of data, a total of 4 line.  Relevant contents - # TYPE, Selected, System, Collections, Hashtable system object : count 953 I haven't had the time today to look into using the Get-AdvancedSetting cmdlet. T.

Reply
0 Kudos
LucD
Leadership
Leadership

Try like this

$esxName = 'MyEsx'

$esx = Get-VMHost -Name $esxName

Get-AdvancedSetting -Entity $esx | Select Name,Value |

Export-Csv C:\vmhostadv.csv -NoTypeInformation -UseCulture


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

Reply
0 Kudos
impranayk
Enthusiast
Enthusiast

Hi LucD

I want to export a specific value in a CSV for all ESXi hosts in a vCenter server. Can you suggest.

Value Name: VMFS3.UseATSForHBOnVMFS5

-------------------------------------------------------------------------
Follow me @ www.vmwareinsight.com
Please consider marking this answer "correct" or "helpful" if you found it useful

Pranay Jha | Blog: http://vmwareinsight.com
vExpert 2016/2017, VCAP5-DCD/DCA, VCP5-DCV, VCA-Cloud, VCE-CIA, MCSE, MCITP
Reply
0 Kudos
LucD
Leadership
Leadership

You could do something like this

Get-VMHost |

Get-AdvancedSetting -Name 'VMFS3.UseATSForHBOnVMFS5' |

select @{N='VMHost';E={$_.Entity.Name}},

    @{N='VMFS3.UseATSForHBOnVMFS5';E={$_.Value}} |

Export-Csv -Path .\report.csv -NoTypeInformation -UseCulture


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

Reply
0 Kudos