Skip to content

Instantly share code, notes, and snippets.

@alastairtree
Created July 28, 2014 14:45
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alastairtree/6777218c2c7facc17282 to your computer and use it in GitHub Desktop.
Save alastairtree/6777218c2c7facc17282 to your computer and use it in GitHub Desktop.
grant read execute permissions to a folder via powershell
$path = "C:\Sites\Website123"
$user = "domain\user"
$acl = Get-Acl $path
$arguments = $user, "ReadAndExecute", "ContainerInherit, ObjectInherit", "None", "Allow"
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $arguments
$acl.SetAccessRule($accessRule)
$acl | Set-Acl $path
@sonik8181
Copy link

Hello,
Could you please assist me how can i set Same rights for multiple folders ?

@olen2006
Copy link

olen2006 commented May 7, 2020

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment