From aee75171fd0a2f700b6d4be0a0257877ea7d3799 Mon Sep 17 00:00:00 2001 From: Gabe Date: Tue, 5 Aug 2025 15:12:49 +0000 Subject: [PATCH] Upload files to "Test Scripts" --- Test Scripts/Get ACLs(needs modifying).ps1 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Test Scripts/Get ACLs(needs modifying).ps1 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