使用Powershell启用\禁用本地组策略 [英] Enable\Disable Local Group policies with powershell

查看:87
本文介绍了使用Powershell启用\禁用本地组策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用Powershell启用或禁用本地组策略以自动执行该过程,我尝试安装远程服务器管理工​​具,但是Powershell中的模块需要将PC放在域中.

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.

是否可以通过powershell启用\禁用本地组策略?

Is there any way to enable\disable a Local group policy with powershell?

推荐答案

使用注册表(请注意,这需要提升):

Use the registry (note that this requires elevation):

Set-ItemProperty -Path <HKLM:RegistryPath> -Name <PropertyToChange> -Value <NewValue>

示例(从Edge启用搜索建议):

Example (Enabling Search Suggestions from Edge):

Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\MicrosoftEdge\SearchScopes" -Name "ShowSearchSuggestionsGlobal" -Value 1

这篇关于使用Powershell启用\禁用本地组策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆