Backup your Distributed Switch configs to a zip file.

This script will backup your Distributed Switch config to a zip file.
You can then use this zip file to restore the vDS to a new vcenter or if your vcenter database corrupts.

Add-PSSnapin VMware.VimAutomation.Core
Add-PSSnapin VMware.VimAutomation.Vds
Connect-VIServer “MyVcenter” -username “username” -pass “password”
$date= (get-date).tostring(‘ddMMMyyy-HHmm’)
$VDSwitches = get-VDSwitch | %{$_.name}
foreach($vdswitch in $VDSwitches){
$filename = “E:\VDSBackup\”+$vdswitch +”-“+ $date+”.zip”
Get-VDSwitch -Name $vdswitch | Export-VDSwitch -Destination $filename
}

Disconnect-viserver -confirm:$False

View the Restore code here >http://www.pcli.me/?p=44

Vmware Link:
http://www.vmware.com/support/developer/PowerCLI/PowerCLI51R2/html/Export-VDSwitch.html