VMware Cloud Community
uswbnc53
Enthusiast
Enthusiast

Export All System Settings

Does anyone know of a way to export all system and configuration settings from a host and load it into an array to compare to a different host? Somewhat like a host profile does.

For instance, I have a health check script that checks for specific static values...like NTP servers, Syslog, Round Robin, etc.... Like the vCheck all these values are manually defined.

There have been instances in our environment where settings, like advanced configuration settings, are accidentally modified, and it was was requested to update the script to check the entire host configuration.

So I was wondering if there is a way to dump all the settings from Get-VMHost into an array and possibly accomplish this with a compare.

0 Kudos
1 Reply
LucD
Leadership
Leadership

That is an interesting topic, and one where you wished you had Host Profiles at your disposal :smileygrin:

But if you do not have Host Profiles, you will have to find other ways.

Go for specific configuration items, fetch them and then compare them.

For example:

$esx1 = Get-VMHost esx1
$esx2 = Get-VMHost esx2

$ntp1 = Get-VMHostNtpServer -VMHost $esx1
$ntp2 = Get-VMHostNtpServer -VMHost $esx2

Compare-Object -ReferenceObject $ntp1 -DifferenceObject $ntp2

And remember the intricacies of the Compare-Object cmdlet !


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

0 Kudos