Hello All,
I'm trying to modify this code so that when it moves the service profile from one UCS domain to another, it does not automatically associate it.
Here is the code:
Import-Module CiscoUcsPS
$devnull = set-ucspowertoolconfiguration -supportmultipledefaultucs $true
$ip1 = "AHC-UCS3"
$ip2 = "ahc-lgh-ucs2"
$srcorg = "org-root"
$destorg = "org-root"
$spname = "DWtest"
$cred1 = Get-Credential
$cred2 = Get-Credential
$ucs1 = Connect-Ucs $ip1 -Credential $cred1
$ucs2 = Connect-Ucs $ip2 -Credential $cred2
$srcorgmo = Get-UcsManagedObject -Dn $srcorg -Ucs $ucs1
$destorgmo = Get-UcsManagedObject -Dn $destorg -Ucs $ucs2
$srcsp = $srcorgmo | Get-UcsServiceProfile -LimitScope -Hierarchy -Ucs $ucs1 -name $spname -type instance | where { $_.GetType().Name -ne "LsVersionBeh" }
$destsp = $destorgmo | get-ucsserviceprofile -LimitScope -Hierarchy -ucs $ucs2 -Name $spname -Type instance | where { $_.GetType().Name -ne "LsVersionBeh" }
$diff = @()
$diff = Compare-UcsManagedObject @($destsp) @($srcsp)
Sync-UcsMo -ucs $ucs2 ($diff) -force -verbose
#echo $srcsp
#echo $destsp
#echo $diff
disconnect-ucs
echo $handle
Get-UcsPSSession | select ucs, uri, version
Thanks,
Jim