1) Get Export policy information:
$export _policy = Get-ncexportpolicy-name Testpolicy-vservercontext svmdes
2) Get Export rules information:
$export _rules = Get-ncexportrule-policy Testpolicy-vservercontext svmdes
Here, if you use the $export_policy variable, you can only get the rules information for Defualt policy. If you need to get the information of the rules in the custom export policy, the "-policy" parameter should be added with the name of the export policy (that is, you do not need to use the first step of the command).
3) Import the rules into another SVM by $export_rules the intermediate variables:
$export _rules | Foreach-object {new-ncexportrule-policy acadiapolicy-vservercontext svmpolicy-clientmatch $_. Clientmatch-readonlysecurityflavor Any-readwritesecurityflavor any}
Note: From the experimental results, the order of the imported rules will be the opposite of the original order.
Reference Links:
https://community.netapp.com/t5/Microsoft-Cloud-and-Virtualization-Discussions/ how-to-apply-an-exportpolicy-to-a-volume/m-p/105264/highlight/false#m4351
NetApp uses the NetApp PowerShell SDK tools in Cmode to import Exportpolicy Rules