While looking for ways to migrate to our new VCenter server, I came across http://www.van-lieshout.com/2009/07/export-and-import-customization-profiles-using-powershell/ which describes how to export your customization specs (passwords and all) and then reimport them into the new VC.
Export
$path="d:temp"
#Export Customization Profiles
$view = get-view CustomizationSpecManager
ForEach ($CustomizationProfile in $view.info) {
$xml = $view.CustomizationSpecItemToXml($view.GetCustomizationSpec($CustomizationProfile.name))
$xml | Out-File ($path + "" + ($CustomizationProfile.name) + ".xml")
}
Import
$path="d:temp"
#Import Customization Profiles
$view = Get-View CustomizationSpecManager
ForEach ($xmlfile in (Get-ChildItem -Path $path | where {$_.extension -eq ".xml"})) {
$xml = Get-Content ($xmlfile)
$view.CreateCustomizationSpec($view.XmlToCustomizationSpecItem($xml))
}
Comments
Post a Comment