<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using Powershell to export all qtrees from a source-svm and importing it on a dest-svm in ONTAP Discussions</title>
    <link>https://community.netapp.com/t5/ONTAP-Discussions/Using-Powershell-to-export-all-qtrees-from-a-source-svm-and-importing-it-on-a/m-p/155591#M35057</link>
    <description>&lt;P&gt;For what it's worth, the data is there. I am NOT a PowerShell guy, but playing around, I found this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Connect-NcController -Name 192.168.0.101 -Credential (Get-Credential)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use the "Get-NcQtree", you are correct, it does not DISPLAY the ExportPolicy. However, if I do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$a = Get-NcQtree&lt;/P&gt;
&lt;P&gt;$a.ExportPolicy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This outputs all the defined Export Policies.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;PS C:\Users\Administrator.DEMO&amp;gt; &lt;STRONG&gt;Get-NcQtree&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Volume    Qtree Status SecurityStyle Oplocks Vserver&lt;BR /&gt;------    ----- ------ ------------- ------- -------&lt;BR /&gt;myluns          normal          unix enabled    svm0&lt;BR /&gt;svm0_root       normal          unix enabled    svm0&lt;BR /&gt;vol1        t1  normal          unix enabled    svm0&lt;BR /&gt;vol1            normal          unix enabled    svm0&lt;BR /&gt;svm1_root       normal          unix enabled    svm1&lt;BR /&gt;vol2            normal          unix enabled    svm1&lt;BR /&gt;&lt;BR /&gt;PS C:\Users\Administrator.DEMO&amp;gt; $a = Get-NcQtree&lt;BR /&gt;PS C:\Users\Administrator.DEMO&amp;gt; $a.ExportPolicy&lt;BR /&gt;default&lt;BR /&gt;default&lt;BR /&gt;me&lt;BR /&gt;vol1&lt;BR /&gt;default&lt;BR /&gt;vol2&lt;BR /&gt;PS C:\Users\Administrator.DEMO&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;(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&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps you to figure out what you need.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2020 17:41:45 GMT</pubDate>
    <dc:creator>TMACMD</dc:creator>
    <dc:date>2020-04-16T17:41:45Z</dc:date>
    <item>
      <title>Using Powershell to export all qtrees from a source-svm and importing it on a dest-svm</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Using-Powershell-to-export-all-qtrees-from-a-source-svm-and-importing-it-on-a/m-p/155586#M35055</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we use a script to export and import export-policies including their client-matchlist from source to destination svms (&lt;A href="http://scottharney.com/powershell-scripts-for-backup-of-cdot-nfs-exports/" target="_blank"&gt;http://scottharney.com/powershell-scripts-for-backup-of-cdot-nfs-exports/&lt;/A&gt;) which works fine, but we need a bit more...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anybody good with Powershell?&lt;/P&gt;
&lt;P&gt;get-ncqtree delivers the qtrees&lt;/P&gt;
&lt;P&gt;get-ncexportpolicy delivers the policies but shows multiple ones for the same volume instead of listing the qtrees...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 11:13:05 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Using-Powershell-to-export-all-qtrees-from-a-source-svm-and-importing-it-on-a/m-p/155586#M35055</guid>
      <dc:creator>Thomas_</dc:creator>
      <dc:date>2025-06-04T11:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using Powershell to export all qtrees from a source-svm and importing it on a dest-svm</title>
      <link>https://community.netapp.com/t5/ONTAP-Discussions/Using-Powershell-to-export-all-qtrees-from-a-source-svm-and-importing-it-on-a/m-p/155591#M35057</link>
      <description>&lt;P&gt;For what it's worth, the data is there. I am NOT a PowerShell guy, but playing around, I found this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Connect-NcController -Name 192.168.0.101 -Credential (Get-Credential)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I use the "Get-NcQtree", you are correct, it does not DISPLAY the ExportPolicy. However, if I do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$a = Get-NcQtree&lt;/P&gt;
&lt;P&gt;$a.ExportPolicy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This outputs all the defined Export Policies.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;PS C:\Users\Administrator.DEMO&amp;gt; &lt;STRONG&gt;Get-NcQtree&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Volume    Qtree Status SecurityStyle Oplocks Vserver&lt;BR /&gt;------    ----- ------ ------------- ------- -------&lt;BR /&gt;myluns          normal          unix enabled    svm0&lt;BR /&gt;svm0_root       normal          unix enabled    svm0&lt;BR /&gt;vol1        t1  normal          unix enabled    svm0&lt;BR /&gt;vol1            normal          unix enabled    svm0&lt;BR /&gt;svm1_root       normal          unix enabled    svm1&lt;BR /&gt;vol2            normal          unix enabled    svm1&lt;BR /&gt;&lt;BR /&gt;PS C:\Users\Administrator.DEMO&amp;gt; $a = Get-NcQtree&lt;BR /&gt;PS C:\Users\Administrator.DEMO&amp;gt; $a.ExportPolicy&lt;BR /&gt;default&lt;BR /&gt;default&lt;BR /&gt;me&lt;BR /&gt;vol1&lt;BR /&gt;default&lt;BR /&gt;vol2&lt;BR /&gt;PS C:\Users\Administrator.DEMO&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;(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&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps you to figure out what you need.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 17:41:45 GMT</pubDate>
      <guid>https://community.netapp.com/t5/ONTAP-Discussions/Using-Powershell-to-export-all-qtrees-from-a-source-svm-and-importing-it-on-a/m-p/155591#M35057</guid>
      <dc:creator>TMACMD</dc:creator>
      <dc:date>2020-04-16T17:41:45Z</dc:date>
    </item>
  </channel>
</rss>

