diff --git a/Test Scripts/Get ACLs(needs modifying).ps1 b/Test Scripts/Get ACLs(needs modifying).ps1 new file mode 100644 index 0000000..fd4f1ec --- /dev/null +++ b/Test Scripts/Get ACLs(needs modifying).ps1 @@ -0,0 +1,15 @@ +Get-ChildItem "C:\" -Directory -Recurse -Depth 1 | get-acl | Where {-NOT $_.AreAccessRulesProtected} | +Select @{Name="Path";Expression={Convert-Path $_.Path}},AreAccessRulesProtected | +format-table -AutoSize | +#Out-File "C:\Temp\ACL.csv" -Force + + + + + +$acl = get-acl c:\work\demo2 +$acl.SetAccessRuleProtection.OverloadDefinitions +$acl.SetAccessRuleProtection($False,$True) +set-acl -Path c:\work\demo2 -AclObject $acl +dir c:\work -Directory -recurse | get-acl | Where {$_.AreAccessRulesProtected} | set-inheritance -whatif +Set-Inheritance C:\work\demo1 -NoInherit \ No newline at end of file