<?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: Creating a Share and Setting permissions on it in Microsoft Virtualization Discussions</title>
    <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Creating-a-Share-and-Setting-permissions-on-it/m-p/65882#M3295</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could put the single character permission type in one text file as an additional field and read that in as well.&amp;nbsp; Then add If statements to control the permission type on the Set line based on that single value in the only file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Feb 2013 07:23:15 GMT</pubDate>
    <dc:creator>JBRUNS2012</dc:creator>
    <dc:date>2013-02-12T07:23:15Z</dc:date>
    <item>
      <title>Creating a Share and Setting permissions on it</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Creating-a-Share-and-Setting-permissions-on-it/m-p/65871#M3293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to run a PowerShell script on windows server 2008 R2 to create user shares on NetApp and set permissions on them.&lt;/P&gt;&lt;P&gt;What is the easiest way to do that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 06:38:51 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Creating-a-Share-and-Setting-permissions-on-it/m-p/65871#M3293</guid>
      <dc:creator>BAHRAMRUSHENAS</dc:creator>
      <dc:date>2025-06-05T06:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Share and Setting permissions on it</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Creating-a-Share-and-Setting-permissions-on-it/m-p/65878#M3294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm working on the same thing. I've got a script that does it, however it takes 3 text files per share to do it. You also need a master "shares.txt' file that is nothing but a list of the shares you are trying to create.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First thing is to create a text file with the share names. Then you create 3 text files for each sheare. One that has a list of users that need full control, one for Change, and one for Read only. These lists of users need to be in the following format;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Domain\username or Domain\groupname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best thing is to have all of the text files together, but is not a requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$servershares = (Get-Content c:\scripts\TEST\shares.txt)&lt;BR /&gt;$vp = '/vol/Volumename/directory_or_qtreename'&amp;nbsp; (The Volume path on the Netapp)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#This creates the directory and sets the permissions to Everyone full control&lt;/P&gt;&lt;P&gt;foreach ($share in $servershares) {&lt;BR /&gt;New-NaDirectory -path $VP/$share -Permission 777&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#This creates the Share on that NEW directory. It also sets the permissions to everyone Full control.&lt;BR /&gt;Add-NaCifsShare $share -path $VP/$share -Comment 'Powershell test'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#This re-sets the permissions on the Share (not NTFS permissions) to specified groupsor users based on the text files.&lt;/P&gt;&lt;P&gt;$ShareF = (get-content c:\scripts\TEST\"$share"F.txt)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach ($fcu in $ShareF) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set-NaCifsShareAcl $share $fcu "Full Control"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;$ShareC = (get-content c:\scripts\TEST\"$share"C.txt)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach ($ccu in $ShareC) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set-NaCifsShareAcl $share $ccu "Change"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;$ShareR = (get-content c:\scripts\TEST\"$share"R.txt) &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Foreach ($rcu in $ShareR) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set-NaCifsShareAcl $share $rcu "Read"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know it's a bit clunky and it requires a lot of prepwork in getting the txt files set-up. I also need to figure out a way to get it to work on sub-directories, but it is a start.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Jan 2013 17:05:03 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Creating-a-Share-and-Setting-permissions-on-it/m-p/65878#M3294</guid>
      <dc:creator>jjd003166</dc:creator>
      <dc:date>2013-01-08T17:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a Share and Setting permissions on it</title>
      <link>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Creating-a-Share-and-Setting-permissions-on-it/m-p/65882#M3295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could put the single character permission type in one text file as an additional field and read that in as well.&amp;nbsp; Then add If statements to control the permission type on the Set line based on that single value in the only file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 07:23:15 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Creating-a-Share-and-Setting-permissions-on-it/m-p/65882#M3295</guid>
      <dc:creator>JBRUNS2012</dc:creator>
      <dc:date>2013-02-12T07:23:15Z</dc:date>
    </item>
  </channel>
</rss>

