View Only
  • 1.  Export All System Settings

    Posted Feb 25, 2014 11:47 PM

    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 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.

  • 2.  RE: Export All System Settings

    Posted Feb 26, 2014 06:39 AM

    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 !