- $ACL = Get-Acl -Path 'C:\Program Files\New Folder'
- $newRule = New-Object System.Security.AccessControl.FileSystemAccessRule("users", "FullControl", "Allow")
- $ACL.AddAccessRule($newRule)
- Set-Acl -Path 'C:\Program Files\New Folder' -AclObject $ACL
Help with ACL
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- WSUsoftware
- Posts: 30
- Last visit: Thu Feb 17, 2022 2:52 pm
Help with ACL
I have searched the forums first, but I'm still having some troubles. I am trying to simulate checking the Full Control box on the folder below for the Users group.
I have tried the following lines of code without success:
- WSUsoftware
- Posts: 30
- Last visit: Thu Feb 17, 2022 2:52 pm
- WSUsoftware
- Posts: 30
- Last visit: Thu Feb 17, 2022 2:52 pm
Re: Help with ACL
The new rule is showing up correctly but is basically having no affect because the "old" Users rules still exists. Is there a way to remove that one first? I tried but was unsuccessful. Below is what the advanced permissions look like; the highlighted rule is the one I just created.
- WSUsoftware
- Posts: 30
- Last visit: Thu Feb 17, 2022 2:52 pm
Re: Help with ACL
Unfortunately a piece of software we are using requires the Users group for that particular folder to have FullControl permissions to function properly.