Skip to content

Instantly share code, notes, and snippets.

@thomasrayner
Created June 24, 2016 14:05
Show Gist options
  • Save thomasrayner/deee859d47241391080f10f12948c1bb to your computer and use it in GitHub Desktop.
Save thomasrayner/deee859d47241391080f10f12948c1bb to your computer and use it in GitHub Desktop.
$dir = 'c:\temp'
$who = 'domain\user'
$acl = Get-Acl $dir
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule($who,"Modify, DeleteSubdirectoriesAndFiles","ContainerInherit, ObjectInherit","None","Allow")
$acl.AddAccessRule($rule)
Set-Acl $dir $acl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment