Automation

 View Only
  • 1.  Edit a host profile

    Posted Dec 05, 2023 09:26 AM

    Is it possible to edit a host profile using powercli?

    We need to change our syslog server and I have scripts to edit the syslog entry on the ESXi hosts, but I see no way to edit the host profiles. I see cmdlets to create, re-apply host profiles, but not how to edit a specific setting.

    Change the ESXi config, generate a new profile and apply that, is not an option since we have a number of items we need to exclude which also can't be done through powercli I think.

     



  • 2.  RE: Edit a host profile
    Best Answer

    Posted Dec 05, 2023 09:53 AM

    Theoretically yes, in practice rather no.
    The layout and structure of these host profiles are not extensively documented I'm afraid.
    You can do some reverse engineering and try to find out which setting goes where and in which format, like I did with he ESXi root password in the past, but it is a daunting task (which I don't really want to try).



  • 3.  RE: Edit a host profile

    Posted Dec 05, 2023 10:00 AM

    Was afraid so. Looking at doing this through API but not sure if that has the options I need.



  • 4.  RE: Edit a host profile

    Posted Dec 07, 2023 04:33 PM

    This is also one of the reasons I stopped using Profiles and moved to a script that sets up the same thing using a lot of lines like:

    $vmhost | Get-AdvancedSetting -Name UserVars.ESXiShellTimeOut | Set-AdvancedSetting -Value $ShellTimeOut -Confirm:$false
    or
    $vmhost | Get-VmHostService | Where {$_.key -eq "ntpd"} | Set-VMHostService -policy $NTP