Backup or Restore SPBM Profiles in vCenter

This script will either export SPBM policies to a folder or import SPBM policies from a folder.

Tested on vCenter 6.5 with PowerCLI 6.5, but should work with earlier versions.

Syntax is:
To Backup SPBM Policies to a Folder
XFER-SPBM-Policies.ps1 -Server -Action export -FilePath

To Restore SPBM Policies from a Folder
XFER-SPBM-Policies.ps1 -Server -Action import -FilePath

Example moving from an old vCenter to a new VCSA:
Connect-VIServer <old vcenter>
XFER-SPBM-Policies.ps1 -Server -Action export -FilePath c:\policies\
Disconnect-VIServer

Connect-VIServer <new VCSA>
XFER-SPBM-Policies.ps1 -Server -Action import -FilePath c:\policies\
Disconnect-VIServer


Sign in to be able to add comments.

Comments 2


6062302539 6 years ago
this is very helpful thank you! I hadnt thought of backing these up separate from my vcenter backups, good idea!
lpeltier 3 years ago
You may need to update this line to make it works correctly in 6.7 (U3 in my case): Export-SpbmStoragePolicy -FilePath $FilePath\$StoragePolicy.Name.xml -StoragePolicy $StoragePolicy.Name -Server $Server -Force -ErrorAction SilentlyContinue