简体   繁体   English

使用Powershell启用\\禁用本地组策略

[英]Enable\Disable Local Group policies with powershell

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启用或禁用本地组策略以自动执行该过程,我尝试安装远程服务器管理工​​具,但是powershell中的模块需要将PC置于域中。

Is there any way to enable\\disable a Local group policy with powershell? 有什么办法可以使用Powershell启用/禁用本地组策略?

Use the registry (note that this requires elevation): 使用注册表(请注意,这需要提升):

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

Example (Enabling Search Suggestions from Edge): 示例(从Edge启用搜索建议):

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 powershell 添加本地组用户策略 - Add Local Group User policies with powershell 使用 reg 键禁用/启用 powershell - Disable/Enable powershell with reg key 启用和禁用TLS和SSL在IE中,在Z0F4137ED1502B5045D6045D6083AA258B58B5C42Z中使用本地机器(不是Z0F4137ED152B502B502602605DDEMEA) - Enable and Disable TLS and SSL in IE on windows 10 local machine(not windows server) using powershell 通过 PowerShell 脚本启用 TLS 和禁用 SSL - Enable TLS and Disable SSL via PowerShell script 使用Powershell向本地用户添加本地组时出错 - Error while adding a local group to local user using powershell 无法使用 Powershell 将组策略(本地 gpo)状态更新为“未配置” - Unable to update group policy(local gpo) status to "Not Configured" using Powershell Windows PowerShell 2 命令捕获组中的本地用户帐户 - Windows PowerShell 2 Command To Capture Local User Accounts In A Group 如何在Windows 7中使用PowerShell 5显示,启用或禁用所有网络适配器? - How can I display, enable or disable all the Network adapters using PowerShell 5 in windows 7? 简单的 Powershell 问题(创建本地 ID 并添加本地管理员组以及一些检查) - Simple Powershell questions (Creating a local ID and adding local administrator group plus some checks) 以编程方式启用Powershell是否可以接受? - Is it acceptable to programmatically enable Powershell?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM