Created
November 30, 2012 23:05
-
-
Save clly/4179341 to your computer and use it in GitHub Desktop.
Setting ACLs on a folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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