New
#1
How to Deny Full Control of this Registry Key?
Hi, everyone
I hope to deny the full control permission of administrator account on registry key named as "HKCU:\Control Panel\Keyboard".
I have some failed PowerShell command codes, please you correct them.
Thanks a lot.
The failed PowerShell command codes as following.
$acl = Get-Acl 'HKCU:\Control Panel\Keyboard'
$acl.Access
$idRef = [System.Security.Principal.NTAccount]("DESKTOP-R5J32KL\USER")
$regRights = [System.Security.AccessControl.RegistryRights]:eny
$inhFlags = [System.Security.AccessControl.InheritanceFlags]::None
$acType = [System.Security.AccessControl.AccessControlType]:eny
$rule = New-Object System.Security.AccessControl.RegistryAccessRule ($idRef, $regRights, $inhFlags, $prFlags, $acType)
$acl.AddAccessRule($rule)
$acl.SetAccessRule($rule)
$acl | Set-Acl -Path 'HKCU:\Control Panel\Keyboard'
First picture as attached is my registry key information.
Second picture as attached is PowerShell registry key information.
Third picture as attached is total PowerShell errors.
Last picture as attached is the final result, and nothing happened.