Export and Import VMware customization specs

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 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 Customization Profiles
$view = Get-View CustomizationSpecManager
ForEach ($xmlfile in (Get-ChildItem -Path $path | where {$_.extension -eq ".xml"})) {
$xml = Get-Content ($xmlfile)

One thought on “Export and Import VMware customization specs

  • June 22, 2011 at 5:05 pm

    Export PS fixed:
    if ((Get-PSSnapin -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue) -eq $null )
    Add-PsSnapin VMware.VimAutomation.Core
    $connection = Connect-VIServer wtnintprdsrmvm1.nt.local
    #Export Customization Profiles
    $views = get-view CustomizationSpecManager
    foreach ($view in $views) {
    foreach ($CustomizationProfile in $view.info) {
    $xml = $view.CustomizationSpecItemToXml($view.GetCustomizationSpec($CustomizationProfile.name));
    $xml | Out-File ($path + "" + ($CustomizationProfile.name) + ".xml")

Leave a Reply