Enable\Disable Local Group policies with powershell

北城以北 提交于 2021-01-29 10:10:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!