Skip to content

Instantly share code, notes, and snippets.

@clly
Created November 30, 2012 20:16
Show Gist options
  • Save clly/4178304 to your computer and use it in GitHub Desktop.
Save clly/4178304 to your computer and use it in GitHub Desktop.
Set access control with powershell
# hello.txt is a file in the current directory
# The group everyone will be added to allow it full control
$group = "Everyone"
$control = "FullControl"
$yesno = "Allow"
$acl = get-acl hello.txt
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule $group,$control,$yesno
$acl.SetAccessRule($rule)
$acl | Set-Acl hello.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment