johnsmain
Contributor
Contributor

PowerCLI to automate export of host customizations

First Time Caller, Long Time Worshiper.

Extensive Powershell and PowerCLI experience, but I've hit a wall.

I am looking for a hint of how to automate the manual VC activity known as:

Host Profiles -> Export Host Customizations

I have the scripting in place to handle updating the resulting .csv with the new accounts and passwords.

(The trick was to NOT use PowerCLI cmdlets to edit the _host_customizations.csv, but rather to use .NET to do the find/replace(s)

     $inFile = "c:\server.domain.com_host_customizations.csv"

     $outFile = "c:\server.domain.com_host_customizations_updated.csv"

     $content = [System.IO.File]::ReadAllText($inFile).Replace("oldpassword","newpassword")

     [System.IO.File]::WriteAllText($outFile, $content)

)

The obvious follow-on question would be how to automate the manual VC activity known as:

Host Profiles -> Edit Host Customizations  and import the .csv

We have to change the accounts and passwords used for AD access from the ESXi hosts routinely/monthly,

and this is quite the mind-numbing process.

Any assistance would be wonderful.

0 Kudos
1 Reply
mthiha207au
Contributor
Contributor

johnsmain​ I am in similar situation and need to automate this. Did you manage to find a way?

0 Kudos