如何使应用程序GPO感知?

I'm writing an application in Delphi 2010, and I'd like to provide the option to the administrator to configure it via Group Policy. Any recommendations on good ways to make my application GPO aware? Note, I am only looking to create a computer based GPO, not user.

My current solution involves simply first determining if any values have been written to the registry at HKLM\software\policies\MyProgram. If they have, I assume that GPO has been applied and I use this location to read configuration.

If nothing exists at the above registry location, I proceed to reading configuration at the standard location, whether that's an INI file, or another reg key does not matter. At this point, I make the assumption in the program that group policies are not being used.

Would anyone suggest a better way to make this application GPO aware?

#0

It's not that you have to be group policy aware, it's that the group policy has to be aware of the registry keys your program uses.

The purpose of custom Group Policy Templates is to have a user-interface for managing a custom set of registry keys used by a particular program. The domain administrator sets the policy to the desired values, and the policy is pushed out to machines on the domain.

In your case, the custom policy template will define the corresponding HKLM registry keys that your program uses. You can now trust that the values stored in:

HKLM\Software\MickSoftware\My Program 2010

are what the administrator has desired be there.


Note: The following "policy" registry locations are non-persistent:

HKEY_LOCAL_MACHINE\SOFTWARE\Policies
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies
HKEY_CURRENT_USER\SOFTWARE\Policies
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies

"This means that when you log off the computer or when you shut down the computer, the policy settings are removed."

So it seems to me you want to store your registry values where you normally store them, e.g.:

HKLM\Software\Avatar Software Creations\HelpDesk\DatabaseServer
    ServerName: REG_SZ = "lithium"
    UserID: REG_SZ = "helpdesk"
    Password: REG_SZ = "aSBsb3ZlIHlvdSBLaXJzdGVuIFNoZWxieSBHdXllcg=="

推荐文章

Excel条件格式自引用

Excel条件格式自引用

推荐文章

在sql查询的where子句中检查当前日期的最佳方法

在sql查询的where子句中检查当前日期的最佳方法

推荐文章

Laravel Carbon

Laravel Carbon

推荐文章

Cf序列化器-Serializer解析

Cf序列化器-Serializer解析

推荐文章

用Delphi检测internet连接激活

用Delphi检测internet连接激活

推荐文章

提高asp脚本的性能,运行需要3分钟以上的时间

提高asp脚本的性能,运行需要3分钟以上的时间

推荐文章

Laravel 开发 RESTful API 的一些心得

Laravel 开发 RESTful API 的一些心得

推荐文章

如何在dbx中使用blob参数执行sql命令?

如何在dbx中使用blob参数执行sql命令?

推荐文章

使用html浏览器显示xml数据有什么区别?

使用html浏览器显示xml数据有什么区别?

推荐文章

在Laravel5.5中使用vue渲染具体过程与总结

在Laravel5.5中使用vue渲染具体过程与总结

推荐文章

你用数学做过哪些特殊的软件开发任务?你用哪门数学?

你用数学做过哪些特殊的软件开发任务?你用哪门数学?

推荐文章

在php中无法显示表外数据库中的图像

在php中无法显示表外数据库中的图像

推荐文章

laravel+vue多对多关联表进行点赞关注等功能

laravel+vue多对多关联表进行点赞关注等功能

推荐文章

绑定文件中的BizTalk SOAP端口密码

绑定文件中的BizTalk SOAP端口密码

推荐文章

有在Apache C模块上运行单元测试的框架吗?

有在Apache C模块上运行单元测试的框架吗?

推荐文章

Laravel最佳实践--API请求频率限制(Throttle中间件)

Laravel最佳实践--API请求频率限制(Throttle中间件)