question

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT asked YoungYang-MSFT answered

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YoungYang-MSFT avatar image
0 Votes"
YoungYang-MSFT answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.