Skip to content

Instantly share code, notes, and snippets.

@p0w3rsh3ll
Created Jun 11, 2022
Embed
What would you like to do?
# Set a Deny of user on .pdf key
$acl = Get-Acl -Path $extRegKeyPath
$rule = New-Object System.Security.AccessControl.RegistryAccessRule (
$user,
([System.Security.AccessControl.RegistryRights]::CreateSubKey+[System.Security.AccessControl.RegistryRights]::ChangePermissions),
[System.Security.AccessControl.AccessControlType]::Deny
)
$null = $acl.AddAccessRule($rule)
Set-Acl -Path $acl.Path -AclObject $acl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment