Created
February 4, 2021 17:16
-
-
Save joeywas/131932b032ff21b1bd250dcd702bec0c to your computer and use it in GitHub Desktop.
recursive acl change
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
$acl = Get-Acl -Path "H:\" | |
$acl.SetAccessRuleProtection($true,$false) | |
$acl.Access | ForEach-Object { $acl.RemoveAccessRule($_) | Out-Null } | |
$ace = New-Object System.Security.Accesscontrol.FileSystemAccessRule ("Everyone", "FullControl", "ContainerInherit,ObjectInherit", "InheritOnly", "Allow") | |
$acl.AddAccessRule($ace) | |
Set-Acl -Path "H:\" -AclObject $acl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment