Created
July 28, 2014 14:45
-
-
Save alastairtree/6777218c2c7facc17282 to your computer and use it in GitHub Desktop.
grant read execute permissions to a folder via 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
$path = "C:\Sites\Website123" | |
$user = "domain\user" | |
$acl = Get-Acl $path | |
$arguments = $user, "ReadAndExecute", "ContainerInherit, ObjectInherit", "None", "Allow" | |
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule $arguments | |
$acl.SetAccessRule($accessRule) | |
$acl | Set-Acl $path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Could you please assist me how can i set Same rights for multiple folders ?