Principal Inherited from SYSTEM False
icacls $path /inheritance:d
$path = "F:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn" $acl = get-acl $path icacls $path /reset /t /c /l /q icacls $path /inheritance:d Set-Acl -Path $path -AclObject $acl # Check the existing rights $acl.Access | where IdentityReference -Like 'BUILTIN\Users' # Get a list of the rules to remove $rules = $acl.access | Where-Object { !$_.IsInherited -and $_.IdentityReference -like 'BUILTIN\Users' -and $_.FileSystemRights -in 'CreateFiles, AppendData' } ForEach($rule in $rules) { $acl.RemoveAccessRule($rule) } $acl.Access Set-Acl -Path $path -AclObject $acl
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)