New-Item fails on "Policies" hive with access denied

Ian Xue 37,021 Reputation points Microsoft Vendor
2020-07-16T03:08:35.977+00:00

It seems I can't write under policies, but directy I can. I need to alter something in registery under Policies. Is this doable?

New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\System" -Force     
New-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\System" -Name DisableAcrylicBackgroundOnLogon -Value "1" -PropertyType DWord -Force 

= access denied

New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\System" -Force     
New-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\System" -Name DisableAcrylicBackgroundOnLogon -Value "1" -PropertyType Dword -Force 

= success

https://social.technet.microsoft.com/Forums/windowsserver/en-US/7e2507bd-c472-4147-8714-d6a71b45c4af/newitem-fails-on-quotpoliciesquot-hive-with-access-denied?forum=winserverpowershell#73bd193b-95f4-4faf-a642-71d51743456a

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,526 questions
0 comments No comments
{count} votes

Accepted answer
  1. 2020-07-16T06:03:12.51+00:00

    Hi,

    Have you tried to use administrator account to run the command?

    It works for me.

    If you got the access denied error, I think you are having a permissions issue.

    But as Jrv said, It is useless to modify GP registry.

    Best regards,

    Young Yang

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.