$ACL = Get-Acl "C:\New Folder"
$AuditRule = New-Object Security.AccessControl.FileSystemAuditRule("everyone","Modify","ContainerInherit, ObjectInherit", "None", "success")
$ACL.AddAuditRule($AuditRule)
# Rule for Delete SubFolders and Files
$AuditRule = New-Object Security.AccessControl.FileSystemAuditRule("everyone","Delete","ContainerInherit, ObjectInherit", "InheritOnly", "success")
$ACL.AddAuditRule($AuditRule)
$ACL | Set-Acl "C:\New Folder"
|