Hi all, I am trying to remove a specific special permission from a ACL. In this example the Delete subfolders and files permission already assigned to the marketing group. When I run the script it removes the permission (win) but then creates a new ACE for marketing granting them the permission (WTF?). So I am obviously failing somewhere or just going about this completely wrong. So anyone that can assist please help and if its not to much trouble could you send script corrections or replacements using full syntax and no alias's as I am trying to learn as I go. Thanks in advance
# Set Variables
$file = 'D:\TestFolder2'
$UserGroup = 'Domain\Marketing'
$permset1 = 'DeleteSubdirectoriesAndFiles'
# List permissions you would like to remove
$colRights = [System.Security.AccessControl.FileSystemRights]"$permset1"
# Select user \ group
$objUser = [System.Security.Principal.NTAccount]"$UserGroup"
# Create the new ACL
$objACE = [System.Security.AccessControl.FileSystemAccessRule] "$objUser, $colRights"
$objACL = Get-ACL "$file"
# Apply the ACL
Set-ACL $file $objACL