The transition to NetApp MS Azure AD B2C is complete. If you missed the pre-registration, you will be invited to reigister at next log in.
Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

ONTAP Discussions

Using Powershell to export all qtrees from a source-svm and importing it on a dest-svm


Hi there,


we use a script to export and import export-policies including their client-matchlist from source to destination svms ( which works fine, but we need a bit more...


We noticed on our destination svms that the only thing different than on our source svms is the qtree to export-policy association. Basically using the script above the export policy which is default for the volume gets inherited to all the qtrees. But on the source svm we have dedicated policies per qtree.


Anybody good with Powershell?

get-ncqtree delivers the qtrees

get-ncexportpolicy delivers the policies but shows multiple ones for the same volume instead of listing the qtrees...



Thanks for your help!



For what it's worth, the data is there. I am NOT a PowerShell guy, but playing around, I found this:


Connect-NcController -Name -Credential (Get-Credential)


When I use the "Get-NcQtree", you are correct, it does not DISPLAY the ExportPolicy. However, if I do this:


$a = Get-NcQtree



This outputs all the defined Export Policies.


PS C:\Users\Administrator.DEMO> Get-NcQtree

Volume Qtree Status SecurityStyle Oplocks Vserver
------ ----- ------ ------------- ------- -------
myluns normal unix enabled svm0
svm0_root normal unix enabled svm0
vol1 t1 normal unix enabled svm0
vol1 normal unix enabled svm0
svm1_root normal unix enabled svm1
vol2 normal unix enabled svm1

PS C:\Users\Administrator.DEMO> $a = Get-NcQtree
PS C:\Users\Administrator.DEMO> $a.ExportPolicy
PS C:\Users\Administrator.DEMO>

 (notice the "me" in the last output. That is a modified export-policy on the qtree "t1". The hosting volume "vol1" continues to have the "default" export-policy


I hope this helps you to figure out what you need. 

NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner