<?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 PowerShell: Create volume, qtree, associate protection and efficiency policies in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137949#M5630</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to create a PS script which:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Reads variables from an Excel&lt;/P&gt;
&lt;P&gt;2. Creates a volume&lt;/P&gt;
&lt;P&gt;3. Creates one to optinally multiple qtrees in the volume&lt;/P&gt;
&lt;P&gt;4. Associates protection policy to volume&lt;/P&gt;
&lt;P&gt;5. Associates efficiency policy to volume&lt;/P&gt;
&lt;P&gt;6. Creates a share and assigns permissions on each of the qtrees created&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know very little about PS so is there anyone that can give me a starting point pls?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 14:03:21 GMT</pubDate>
    <dc:creator>tyrone_owen_1</dc:creator>
    <dc:date>2025-06-04T14:03:21Z</dc:date>
    <item>
      <title>PowerShell: Create volume, qtree, associate protection and efficiency policies</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137949#M5630</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to create a PS script which:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Reads variables from an Excel&lt;/P&gt;
&lt;P&gt;2. Creates a volume&lt;/P&gt;
&lt;P&gt;3. Creates one to optinally multiple qtrees in the volume&lt;/P&gt;
&lt;P&gt;4. Associates protection policy to volume&lt;/P&gt;
&lt;P&gt;5. Associates efficiency policy to volume&lt;/P&gt;
&lt;P&gt;6. Creates a share and assigns permissions on each of the qtrees created&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know very little about PS so is there anyone that can give me a starting point pls?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 14:03:21 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137949#M5630</guid>
      <dc:creator>tyrone_owen_1</dc:creator>
      <dc:date>2025-06-04T14:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell: Create volume, qtree, associate protection and efficiency policies</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137954#M5631</link>
      <description>&lt;P&gt;This is a community where we try to assist others, but we cannot completely write scripts for people, especially a complete script.&amp;nbsp; The 'user' needs to have some skin in the game for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can get you started, but you have to put some effort in yourself&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What your asking for is very easy to do in powershell and even easier to do with WFA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want a csv file as an import with your header fields.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start looking at get-nchelp or show-nchelp.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will get you started with volume name&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;name junction&amp;nbsp; aggr&amp;nbsp; size&amp;nbsp;&lt;/P&gt;
&lt;P&gt;vol1&amp;nbsp; &amp;nbsp;/vol1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;aggr1&amp;nbsp; 10g&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$vols - this will represent the above.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$vols = import-csv createvols.csv&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;$vols&amp;nbsp; | % {&lt;/P&gt;
&lt;P&gt;new-ncvol -name $_.name&amp;nbsp; -aggregate $_.aggr "&amp;nbsp; -junctionpath $_.junction&amp;nbsp;$_.size&amp;nbsp;&amp;nbsp;-spacereserve "none"&amp;nbsp;&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's a for loop iterating thru your array.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can start with that.&amp;nbsp; Powershell is not intimidating once you get the basics..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:29:55 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137954#M5631</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2018-02-09T12:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell: Create volume, qtree, associate protection and efficiency policies</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137956#M5632</link>
      <description>&lt;P&gt;Thanks for the reply&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't recall asking anyone to write the script for me though I'll obviously take one if it exists!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unfortunately WFA means another VM on top of the OCUM and OCCM VMs so not possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 12:39:58 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137956#M5632</guid>
      <dc:creator>tyrone_owen_1</dc:creator>
      <dc:date>2018-02-09T12:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell: Create volume, qtree, associate protection and efficiency policies</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137959#M5633</link>
      <description>&lt;P&gt;Sorry i read it fast and it came across as, please write these for me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending how much you provision WFA might not be worth it, and you can do whatever you want in powershell&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 13:12:28 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137959#M5633</guid>
      <dc:creator>JGPSHNTAP</dc:creator>
      <dc:date>2018-02-09T13:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: PowerShell: Create volume, qtree, associate protection and efficiency policies</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137961#M5634</link>
      <description>&lt;P&gt;No worries - thanks&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 13:45:44 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Create-volume-qtree-associate-protection-and-efficiency-policies/m-p/137961#M5634</guid>
      <dc:creator>tyrone_owen_1</dc:creator>
      <dc:date>2018-02-09T13:45:44Z</dc:date>
    </item>
  </channel>
</rss>

