Exports/shares exist at the SVM level with clustered Data ONTAP, not the cluster level. If you have more than one SVM, then you'll want to loop over them with some sort of map of old->new SVM names.
$source_cluster = 1.1.1.1
$source_username = "admin"
$source_password = "password"
$destination_cluster = 2.2.2.2
$destination_username = "admin"
$destination_password = "password"
# create a key value map of the SVMs
$svm_map = @{
'old_svm_1' = 'new_svm_1';
'old_svm_2' = 'new_svm_2';
}
# backup from source, restore to destination
$svm_map.GetEnumerator() | %{
# backup source
Write-Host "Outputing SVM $($_.Key) shares to XML"
.\backupSharesAcls.ps1 `
-server $source_cluster `
-user $source_username `
-password $source_password `
-vserver $_.Key `
-share * `
-shareFile ".\$($_.Key)_shares.xml" `
-aclFile ".\$($_.Key)_acls.xml" `
-spit more
# restore to destination
Write-Host "Restoring SVM $($_.Key) shares to SVM $($_.Value)"
.\restoreSharesAcls.ps1 `
-server $destination_cluster `
-user $destination_username `
-password $destination_password `
-vserver $_.Value `
-shareFile ".\$($_.Key)_shares.xml" `
-aclFile ".\$($_.Key)_acls.xml" `
-spit more
}
Andrew
If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.