如何使用PowerShell或CMD启用组策略切换按钮
我正在尝试使用UserData自动化Windows 2019服务器的切割设置。我需要更新本地组策略设置。
我要启用的特定组策略是“设置断开连接会话的时间限制”
如何使用PowerShell或Bash甚至重新启动VM启用此'本地'组策略。
我已经尝试过,但我似乎无法将其处于“启用”状态。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看此注册表编辑。
您可以访问此
更多信息此处。
Look at this Registry Edit.
You can access this registry key in Powershell or Bash.
More information here.
尝试一下,它是相同的注册表密钥,但使用PowerShell设置。
该值在MS中,将其设置为15分钟。
运行该设备后,重新启动设备和设置应更新。
Try this, its the same registry key but using Powershell to set.
The value is in ms, this would set it to 15 minutes.
https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.TerminalServer::TS_SESSIONS_Disconnected_Timeout_2
After you run that, restart the device and the settings should be updated.
无法使用PowerShell直接配置本地组策略。
配置后,GPO设置注册表密钥和值。
您可以在其中设置注册表密钥,然后配置GPO是双向的。
您可以使用Microsoft的工具 lgpo.exe 从要配置的计算机中导出策略设置,然后使用PowerShell将这些设置导入到新计算机。
There is no way to directly configure the local group policy using PowerShell.
When configured, the GPO sets a registry key and value.
It's not bi-directional where you can set the registry key and then the GPO is configured.
You can use Microsoft's tool LGPO.exe to export the policy settings from a computer you've configured, and then use PowerShell to import those settings to your new computer.