title: Using PowerShell to grant security rights to multiple folders.
body: <p>We have an in-house application that creates a folder, with 8 sub-folders, whenever a new project is started (keeping the same file structure in every folder).  Our fileserver sets the security to the top level folder, breaking any specific sub-folder rights.  </p>
  
  <p>I'm looking at using a<a href="https://stackoverflow.com/questions/10529315/trigger-script-when-new-folder-has-been-added-to-a-location">This System.IO.FileSystemWatcher</a> to automate the PowerShell, once the folders have been created.  </p>
  
  <p>The PowerShell I'm looking at using is:</p>
  
  <pre><code>    New-Item F:\Engineering Projects\TPS\Documents\ –Type Directory
  Get-Acl F:\Engineering Projects\TPS\Documents\ | Format-List
  
  $acl = Get-Acl F:\Engineering Projects\TPS\Documents\
  $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 F:\Folder $acl
  
  Get-Acl F:\Folder  | Format-List
  </code></pre>
  
  <p>I'm not very experienced with PowerShell, Exchange things being the main area where I've experienced it.  Obviously that script is more of a generic starting point for me; my question is, would I run this script multiple times (for each folder requiring specific permissions), or can I incorporate multiple folder permissions within one script?</p>