如何使应用程序知道GPO? [英] How to make an application GPO aware?

查看:126
本文介绍了如何使应用程序知道GPO?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Delphi 2010编写应用程序,我想向管理员提供通过组策略进行配置的选项。关于使我的应用程序了解GPO的好的方法有什么建议?注意,我只希望创建基于计算机的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.

我当前的解决方案仅涉及首先确定是否在处将任何值写入注册表。 > HKLM\软件\策略\MyProgram 。如果有,我认为已经应用了GPO,并使用此位置读取配置。

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.

如果上述注册表位置不存在任何内容,我将继续从以下位置读取配置标准位置,无论是INI文件还是其他注册表项都没有关系。此时,我在程序中假设未使用组策略。

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.

有人会建议一种更好的方法来使该应用程序感知GPO吗?

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

推荐答案

这不是您必须了解组策略,而是组策略必须了解您的程序使用的注册表项。

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.

在您的情况下,自定义策略模板将定义程序使用的相应HKLM注册表项。您现在可以相信存储在以下位置的值:

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

是管理员所希望的。

注意:以下策略注册表位置是非持久性的:

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

>这意味着当您注销计算机或关闭计算机时,策略设置将被删除。

因此在我看来,您想将注册表值存储在通常存储它们的位置,例如:

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=="

这篇关于如何使应用程序知道GPO?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆