Skip to content

Instantly share code, notes, and snippets.

@clly
Created November 30, 2012 23:05
Show Gist options
  • Save clly/4179341 to your computer and use it in GitHub Desktop.
Save clly/4179341 to your computer and use it in GitHub Desktop.
Setting ACLs on a folder
$path = "folder"
$propflag = "None"
$inhflag = [System.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor [System.Security.AccessControl.InheritanceFlags]::ObjectInherit
$user = "DOMAIN\user"
$acl = get-acl $path
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule $user,"FullControl",$inhflag,$propflag,"Allow"
$acl.SetAccessRule($rule)
$acl | Set-Acl $path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment