Protects an ACL so that changes to its parent can't be inherited to it.
Disable-AclInheritance [-Path] <String> [-Preserve] [-WhatIf] [-Confirm] [<CommonParameters>]
Items in the registry or file system will inherit permissions from its parent. The Disable-AclInheritnace
function disables inheritance, removing all inherited permissions. You can optionally preserve the currently inherited permission as explicit permissions using the -Preserve
switch.
This function is paired with Enable-AclInheritance
.
Beginning in Carbon 2.4, this function will only disable inheritance if it is currently enabled. In previous versions, it always disabled inheritance.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Path | String | The file system or registry path whose access rule should stop inheriting from its parent. |
true | true (ByValue, ByPropertyName) | |
Preserve | SwitchParameter | Keep the inherited access rules on this item. |
false | false | False |
WhatIf | SwitchParameter | false | false | ||
Confirm | SwitchParameter | false | false | ||
CommonParameters | This cmdlet supports common parameters. For more information type Get-Help about_CommonParameters . |
Disable-AclInheritance -Path C:\Projects\Carbon
Removes all inherited access rules from the C:\Projects\Carbon
directory. Non-inherited rules are preserved.
Disable-AclInheritance -Path hklm:\Software\Carbon -Preserve
Stops HKLM:\Software\Carbon
from inheriting acces rules from its parent, but preserves the existing, inheritied access rules.