I would like to change the ACL of the C: drive. What im trying to do is remove the permission that a user can create a folder directly on the drive. I tested th
I found the answer. Microsoft says
Unfortunately
Get-Aclis missing some features. It always reads the full security descriptor even if you just want to modify the DACL. That’s whySet-ACLalso wants to write the owner even if you have not changed it. Using theGetAccessControlmethod allows you to specify what part of the security descriptor you want to read.
Replace the Get-Acl call with
$acl = (Get-Item $path).GetAccessControl('Access')