问题
I have been trying to enable or disable a Local group policy with powershell to automate the process, I tried installing Remote Server Administration Tools but it's module in powershell needs the pc to be in a domain.
Is there any way to enable\disable a Local group policy with powershell?
回答1:
Use the registry (note that this requires elevation):
Set-ItemProperty -Path <HKLM:RegistryPath> -Name <PropertyToChange> -Value <NewValue>
Example (Enabling Search Suggestions from Edge):
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\MicrosoftEdge\SearchScopes" -Name "ShowSearchSuggestionsGlobal" -Value 1
来源:https://stackoverflow.com/questions/51785463/enable-disable-local-group-policies-with-powershell