title: How to create folder, share and apply NTFS permissions
body: <p>Being a total novice of Powershell I am trying to put together a script using the below script from various TechNet script examples:</p>
  
  <pre><code>$FolderPath = 'c:\folder'
  
  $Shares=[WMICLASS]'WIN32_Share'
  
  $ShareName='Home$'
  
  New-Item -type directory -Path $FolderPath
  
  $Shares.Create($FolderPath,$ShareName,0)
  
  $Acl = Get-Acl $FolderPath
  $Acl.SetAccessRuleProtection($True, $False)
  $rule = New-Object   System.Security.AccessControl.FileSystemAccessRule('Administrators','FullControl','ContainerInherit, ObjectInherit', 'None', 'Allow')
  $Acl.AddAccessRule($rule)
  $rule = New-Object System.Security.AccessControl.FileSystemAccessRule("Users","Read", "ContainerInherit, ObjectInherit", "None", "Allow")
  $Acl.AddAccessRule($rule)
  
  Set-Acl $FolderPath $Acl
  Get-Acl $FolderPath  | Format-List
  </code></pre>
  
  <p>The above script works quite well in terms of creating the folder and sets the permissions as:</p>
  
  <pre><code>Share: Everyone "Full"
  NTFS: Users "Read"
  </code></pre>
  
  <p>I can't seem to figure out how to apply the below permissions, I am struggling with the parameters for System.Security.AccessControl.FileSystemAccessRule to set the below NTFS permissions.</p>
  
  <pre><code>Set Share permissions:  
  Authenticated Users: change
  Administrators: full control
  
  Set NTFS permissions: 
  Administrators: full control
  SYSTEM: full control
  Authenticated users: list folder/read data &amp; create folders/append data, this folder only
  Creator/Owner: full control, subfolders and files only  
  </code></pre>
  
  <p>Any help will be greatly appreciated.
  Thanks in advance.</p>