简体   繁体   English

如何让GPO知道应用程序?

[英]How to make an application GPO aware?

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. 我正在Delphi 2010中编写应用程序,我想为管理员提供通过组策略配置它的选项。 Any recommendations on good ways to make my application GPO aware? 有关如何让我的应用程序GPO知道的好方法的任何建议? Note, I am only looking to create a computer based GPO, not user. 注意,我只想创建一个基于计算机的GPO,而不是用户。

My current solution involves simply first determining if any values have been written to the registry at HKLM\\software\\policies\\MyProgram . 我目前的解决方案只需先确定是否已将任何值写入HKLM \\ software \\ policies \\ MyProgram中的注册表。 If they have, I assume that GPO has been applied and I use this location to read configuration. 如果有,我假设已经应用了GPO并且我使用此位置来读取配置。

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. 如果上述注册表位置不存在任何内容,我将继续读取标准位置的配置,无论是INI文件还是其他注册表项无关紧要。 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? 有人会建议一个更好的方法来让这个应用程序GPO知道吗?

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. 在您的情况下,自定义策略模板将定义程序使用的相应HKLM注册表项。 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, eg: 因此,在我看来,您希望将注册表值存储在通常存储它们的位置,例如:

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

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

相关问题 如何使 .NET 应用程序“识别大地址”? - How to make a .NET application “large address aware”? 如何让我的 Windows C++/OpenSSL 应用程序识别代理? - How can I make my Windows C++/OpenSSL application proxy-aware? 如何让Windows 8.1意识到我的Delphi应用程序想要支持Per Monitor DPI? - How can I make Windows 8.1 aware that my Delphi application wants to support Per Monitor DPI? 如何使电动势文件dpi意识 - How to make emf file dpi aware "如何使用 PowerShell + GPO 在文件夹内搜索" - How to search inside folder using PowerShell + GPO 如何创建与Windows 7向后兼容的缩放和大小更改Per-Monitor DPI感知应用程序? - How to create a scaling and size-changing Per-Monitor DPI-aware application that is backwards compatible with Windows 7? 如何让Windows了解我用Python编写的服务? - How do I make Windows aware of a service I have written in Python? 如何在GPO中的批量批处理文件/ Powershell脚本中提升Chkdsk的权限 - how to Elevating Privileges for Chkdsk in a mass batchfile/Powershell script in a GPO Metro应用程序可以了解其他应用程序吗? - Can a Metro application be aware of other apps? 如何使用域用户通过 GPO 运行登录 .bat 脚本 - How to run logon .bat script by GPO with domain users
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM