如何以编程方式更改 WMI 设置而不是使用 wmimgmt.msc snappin?
通常你会这样:
- 开始 ->运行
- 输入 wmimgmt.msc 并按 Enter
- 键单击“WMI Control”节点 -> 安全选项卡上的属性
- 单击按钮安全
- 为您刚刚添加的用户添加新用户
- 允许“远程 以
如何 编程方式完成此操作(C# 或 vbs)? 我在网上搜索并找到了一些关于使用 WMIC 来做到这一点的信息,但我不明白如何做到这一点。 如果对您有帮助的话,这是链接。 http://msdn.microsoft.com/en -us/library/aa393613%28v=vs.85%29.aspx
http://msdn.microsoft.com/en -us/library/aa393611%28v=vs.85%29.aspx
http://msdn.microsoft.com/en -us/library/aa822575%28v=vs.85%29.aspx
http://msdn.microsoft.com/en -us/library/aa822576%28v=vs.85%29.aspx
http://msdn.microsoft.com/en -us/library/aa394531%28v=VS.85%29.aspx
非常感谢
Normally you go this way:
- start -> run
- enter wmimgmt.msc and press enter
- riht click on "WMI Control" node ->
properties - on security tab click button security
- add new user
- for user you just add allow "Remote
enable"
How can this be done programmatically(C# or vbs) ?
I searched the web and found sometning about doing it by using WMIC, but I don't understand how to do it.
Here are the links if they helps you.
http://msdn.microsoft.com/en-us/library/aa393613%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa393611%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa822575%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa822576%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa394531%28v=VS.85%29.aspx
Thank you very much
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不会确切地解释如何执行此操作,但由于您正在做的事情需要对 Windows、编程和管理有一定的了解,所以我将简单地为您提供一个源代码链接,您可以将其改编到您的项目中以管理 WMI安全性:
http://www.codeproject.com/KB/system/WmiSecurity.aspx
基本上您应该注意的是以下段落:
因此,在这一点上,一些示例应该足以说明该实用程序的使用。假设您要将域 HelpDesk 组添加到 S223001 计算机上的 CIMV2 和后续命名空间。此外,假设该组应该具有远程连接和读取 WMI 对象的能力。为此:
WmiSecurity /C=S223001 /A /N=Root\CimV2 /M=MyDomain\HelpDesk:REMOTEACCESS /R
希望它能有所帮助。
干杯。
I won't explain exactly how to do this, but since you are doing something that involves some good understanding of windows, programming and administering I will simply give you a link to the source code that you can adapt into your project to manage the WMI security:
http://www.codeproject.com/KB/system/WmiSecurity.aspx
Basically what you should note is the following paragraph:
So at this point, some examples should suffice to illustrate the use of the utility. Suppose you wanted to add the domain HelpDesk group to the CIMV2 and subsequent namespaces on the S223001 computer. Further, suppose this group should have the ability to remotely connect and read WMI objects. To do this:
WmiSecurity /C=S223001 /A /N=Root\CimV2 /M=MyDomain\HelpDesk:REMOTEACCESS /R
Hope that it can help.
Cheers.
您可以使用 WMI 做很多事情。 .net 的 WMI API 正是您所需要的。以下是一些可能有助于实现您的目标的示例和链接。
http://msdn.microsoft.com/en-us/library/Aa394572
http://msdn.microsoft .com/en-us/library/aa393964%28v=vs.85%29.aspx#obtaining_data_from_WMI
WMI 让一切变得简单示例:http://www.csharphelp.com/2006/10/wmi-made-easy-for-c/
在 C# 中使用 WMI 更改用户家长控制设置
http://www.codeproject.com/KB/system/cstcpipwmi.aspx
There are many things you can do with WMI. WMI API for .net is the one you need. Here are few examples and links that may be useful to achieve your objectives.
http://msdn.microsoft.com/en-us/library/Aa394572
http://msdn.microsoft.com/en-us/library/aa393964%28v=vs.85%29.aspx#obtaining_data_from_WMI
WMI made it easy example: http://www.csharphelp.com/2006/10/wmi-made-easy-for-c/
Change users parental control settings using WMI in c#
http://www.codeproject.com/KB/system/cstcpipwmi.aspx