I was trying to use Powershell to automate a task to set special permissions
It consist of special permissions that applies to the root folder, and a
different set of permission to subfolders and files for the SAME user.
I can do it manually but when I try to use set-acl, it doesn't seem to allow
2 access rules for the same user.
No error is reported only the last access rule overwrites whatever setting
was there for that specific user.
Any help will be highly appreciated.
Here is my code:
$str = "CONTOSO\TEST1","Modify, Synchronize","none","none","Allow"
$str1 = "CONTOSO\TEST1","FullControl","ContainerInherit,
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule
$accessRule1 = New-Object System.Security.AccessControl.FileSystemAccessRule
$ACL = get-acl c:\TEST
Set-Acl c:\TEST $ACL # Set the Permission