我正在开发一个Windows应用程序。我希望我的应用程序可以通过自己定义的 GPO 进行配置,以便系统管理员可以单独管理每个组和用户的应用程序行为。
我做了一些研究,但找不到合适的解决方案。
如果我创建一些自定义策略,它们如何到达服务器?
我认为政策应该包括“更改注册表项”。之后,我的应用程序使用本地计算机上的这些条目来配置自身。
例如,我的应用程序有一个存储数据的文件夹。假设默认情况下它是“C:\data”。该路径存储在特定的注册表项中。通过定义组策略,管理员可以更改此路径。于是管理员在服务器端将路径设置为“C:\subfolder\data”。我的本地应用程序现在应该使用此文件夹来存储数据。
我不知道如何解决这个问题。有没有办法将组策略添加到服务器/域控制器上?
我想稍后发布我的应用程序,所以我绝对更喜欢使用安装程序包之类的解决方案。
I am developing a windows application. I want my application to be configurable via own-defined GPOs, that the system administrator can manage my application behaviour for each group and user individually.
I've done some research, but I just could not find a proper solution.
If I create some custom policies, how do they get on the server?
I think the policies should consist of "changing registry entries". After that, my application uses these entries on the local machine to configure itselft.
For example my application has a Folder in which data is getting stored. Let's say it is "C:\data" by default. This path is stored in a specific registry entry. By defining a group policy, the administrator can change this path. So the administrator sets the path to "C:\subfolder\data" on the server side. My local application should now use this folder to store the data.
I could not figure out how to solve this. is there a way to get the group policies onto the server/domain controller?
I'd like to publish my application later, so I definitely prefer a solution using something like an installer package.
发布评论
评论(1)
是的,这是最好的方法。在
HKLM\Software\YourAppNameHere
或HKCU\Software\YourAppNameHere
下创建注册表配置(具体取决于您想要按用户配置还是按计算机配置)。您的应用程序应该只读取注册表项,而不用担心组策略。
然后,您可以创建可安装在域控制器上的 ADM 或 ADMX 文件,或者只是记录注册表项并让管理员创建自己的组策略或以其他方式部署注册表项。
编辑:创建仅部署注册表项的 ADM 或 ADMX 文件的一个很好的示例可以在此 Microsoft 知识库文章中找到:
Yes that is the best way to do it. Create registry configuration under
HKLM\Software\YourAppNameHere
orHKCU\Software\YourAppNameHere
(depending on whether you want per-user or per-machine config).Your application should just read the registry entry and not worry about group policies.
You can then create ADM or ADMX files which you can install on the domain controller, or simply document the registry entries and let administrators create their own group policies or deploy the registry key in another way.
Edit: A good example of creating an ADM or ADMX file which just deploys registry keys is found in this Microsoft KB article: