Skip to content

Instantly share code, notes, and snippets.

@alastairtree
Created July 28, 2014 14:45
Show Gist options
  • 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
@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