简体   繁体   English

使用j-interop对注册表对象设置权限

[英]Set Permissions on a Registry Object with j-interop

Accessing WMI using DCOM requires that the user has permissions on: 使用DCOM访问WMI要求用户具有以下权限:

HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\CLSID{76A64158-CB41-11D1-8B02-00600806D9B6} HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Classes \\ CLSID {76A64158-CB41-11D1-8B02-00600806D9B6}

Unfortunately Windows 7 and Server 2008 have this setup so that the Administrators group does not have full control! 不幸的是,Windows 7和Server 2008具有此设置,因此Administrators组没有完全控制权! TrustedInstaller is the owner and has full control. TrustedInstaller是所有者,拥有完全控制权。

I need to do this via j-interop 我需要通过j-interop做到这一点

Take ownership of the registry object and all sub-objects (to Administrators group) I believe this automatically gives full control permission s. 拥有注册表对象和所有子对象(对Administrators组)的所有权,我相信这会自动授予完全控制权限。

Any help would be massively appreciated 任何帮助将不胜感激

I do not think you can do it via j-interop. 我认为您无法通过j-interop做到这一点。 It can be done by changing the owner of the registry file to Administrator or Distributed COM Users or Performance Monitor Users group and then adding Full Control or Read privileges to the Administrator and user groups over the folder. 可以通过将注册表文件的所有者更改为Administrator或Distributed COM Users或Performance Monitor Users组,然后向该文件夹的Administrator和用户组添加“完全控制”或“读取”特权来完成。

I'm very interested in a programmatic solution to this question. 我对这个问题的程序化解决方案非常感兴趣。 So far I can only do it manually by logging in to the desired system and right-clicking on "Permissions" in regedit. 到目前为止,我只能通过登录所需的系统并右键单击regedit中的“权限”来手动完成此操作。

These links look relevant: 这些链接看起来很相关:

For the second link, the response suggests that Microsoft considers some registry keys should be "protected" by being owned by the TrustedInstaller user, and others not. 对于第二个链接,响应表明Microsoft认为应通过TrustedInstaller用户拥有某些注册表项来“保护”,而其他则不应。 In that case, I wonder if there isn't some other legitimate way to get WMI to work remotely. 在那种情况下,我想知道是否没有其他合法方法可以使WMI远程工作。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM