Created
November 30, 2012 20:16
-
-
Save clly/4178304 to your computer and use it in GitHub Desktop.
Set access control with powershell
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
# 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