Created
February 12, 2019 21:40
-
-
Save karoltheguy/c71473c42592561fde7b1b6e2bfc8e42 to your computer and use it in GitHub Desktop.
Powershell Set folder permission
This file contains hidden or 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
| $aclfolder "C:\MyFolder" | |
| $acl = Get-Acl $aclfolder | |
| $ar = New-Object System.Security.AccessControl.FileSystemAccessRule("username", "FullControl", "Allow") | |
| $acl.SetAccessRule($ar) | |
| Set-Acl -Path $aclfolder -AclObject $acl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment