如何使用 C# 配置组策略?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/981010/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I configure group policies using C#?
提问by Suriyan Suresh
How can I manipulate group policy based restriction for the controlpanel and the taskmanager in C#?
如何在 C# 中为控制面板和任务管理器操作基于组策略的限制?
采纳答案by JMarsch
Have a look at WMI. Here is a link to an article on WMI Group policy objects: http://msdn.microsoft.com/en-us/library/aa375082(VS.85).aspx
看看WMI。这是一篇关于 WMI 组策略对象的文章的链接:http: //msdn.microsoft.com/en-us/library/aa375082(VS.85).aspx
This tool will generate example c# code for you:
WMICodeCreator
此工具将为您生成示例 c# 代码:
WMICodeCreator
回答by Pontus Gagge
回答by JMarsch
you can use Registry key to restriction task manager and control panel easily!
您可以使用注册表项轻松限制任务管理器和控制面板!
回答by Jacob
There is some information on how to edit GPO Registry settings available here: http://msdn.microsoft.com/en-us/library/aa374274(v=VS.85).aspx
这里有一些关于如何编辑 GPO 注册表设置的信息:http: //msdn.microsoft.com/en-us/library/aa374274(v=VS.85).aspx
There is also a good blog post here: http://blogs.msdn.com/b/dsadsi/archive/2009/07/23/working-with-group-policy-objects-programmatically-simple-c-example-illustrating-how-to-modify-a-registry-based-policy.aspx
这里还有一篇很好的博客文章:http: //blogs.msdn.com/b/dsadsi/archive/2009/07/23/working-with-group-policy-objects-programmatically-simple-c-example-illustrating -how-to-modify-a-registry-based-policy.aspx
The examples are in C++ but some clever person may be able to write a .net wrapper.
这些示例是用 C++ 编写的,但一些聪明的人可能会编写一个 .net 包装器。