Command to change Local Group Policy Setting.

VTechConnect 61 Reputation points
2021-11-25T14:13:01.377+00:00

Hello,

Looking for a command to change the local group policy setting.

Ideally, when we change any setting from the local group policy, the related registry key gets created.

I tried to create a registry directly by command, but changes were not applied.

I am trying to enable the below local group policy.

Computer Configuration\Administrative Templates\Windows Components\Windows update**Remove access to use all Windows update features**

After enabling the above policy, the registry key SetDisableUXWUAccess (value 1) gets created under HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate

And then Check for updates gets grayed out.

But, when I directly create the registry key SetDisableUXWUAccess (value 1) under HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate

Then Check for updates won't get gets grayed out.

Hence, looking for a command to enable the below local group policy setting.

Computer Configuration\Administrative Templates\Windows Components\Windows update**Remove access to use all Windows update features**

any help for the command?

Windows for business Windows Server User experience PowerShell
Windows for business Windows Client for IT Pros User experience Other
{count} votes

1 answer

Sort by: Most helpful
  1. Leon Laude 86,026 Reputation points
    2021-11-25T16:10:38.46+00:00

    Hi @VTechConnect ,

    You need to run the GPUpdate /Force command after creating the registry key from the command-line, after that it should be active, sometimes even a reboot is required.

    The command would be:

    New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" -Name "SetDisableUXWUAccess" -Value ”1”  -PropertyType "DWORD"  
    

    ----------

    If the reply was helpful please don't forget to upvote and/or accept as answer, thank you!

    Best regards,
    Leon


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.