[gptalk] Re: Can Group Policy Settings be accessed and set from an application

  • From: "Darren Mar-Elia" <darren@xxxxxxxxxx>
  • To: <gptalk@xxxxxxxxxxxxx>
  • Date: Thu, 26 Oct 2006 09:40:36 -0700

Admin Templates in Vista, like OS' before it, are governed by template
files. In Vista these are called ADMX files and are XML files that govern
where a particular policy makes a setting in the registry. This was the same
with ADMs in previous OS'. These files serve as the template for values that
are written to the registry.pol files in the GPOs. This file is simply a
Unicode-encoded text file that can be read to and written from (see my
polviewer utility for a registry.pol reader). So, programmatically you could
get into this file and write your setting provided you know the value in the
registry that underlies it, which you can glean from the ADMX files in
c:\windows\policydefinitions. 
 
You might also look at the IGroupPolicy object interface. Others on the list
have more experience with this interface than I do but it does provide some
programmatic access into registry policy.
 
Darren
 
 

  _____  

From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx] On
Behalf Of Webmaster eSupport
Sent: Thursday, October 26, 2006 9:08 AM
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] Re: Can Group Policy Settings be accessed and set from an
application


In Vista, there is configuration parameter "Turn Off Program Compatibility
Assistant" defined as a group policy under Computer
Configuration->Administrative Templates->Windows Components->Application
Compatibility. Do you think it's possible to access this configuration
parameter through application code? I've looked up registry.pol on on MSDN
but not seen anything that leads me directly to this parameter. If it's
possible, Vista specific policy info probably not published on MSDN yet. 
 
Dave
 

----- Original Message ----- 
From: Darren Mar-Elia <mailto:darren@xxxxxxxxxx>  
To: gptalk@xxxxxxxxxxxxx 
Sent: Thursday, October 26, 2006 11:09 AM
Subject: [gptalk] Re: Can Group Policy Settings be accessed and set from an
application

Noting changes in particular in Vista. Note that policy areas such as Admin
Templates, and Software Restriction policy store their settings in a
published format (look up registry.pol in MSDN) so its not completely
opaque, but I think that because each CSE has historically been owned by the
respective product groups within MS, and no one dictated a standard set of
interfaces, it would have been difficult for MS to publish this information.
For example, Admin Template settings are driven by ADM/ADMX files but
security settings, for example, are hard-coded into the GP editor DLL
responsible for that extension (for the most part).
 
Darren

  _____  

From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx] On
Behalf Of Webmaster eSupport
Sent: Thursday, October 26, 2006 7:55 AM
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] Re: Can Group Policy Settings be accessed and set from an
application


 
So if I understand this correctly, it is possible to configure group
policies through an appliction with Microsoft's gpedit.msc application, but
Microsoft is just not sharing the methods with anyone so we're not forced to
use their application. That's unbelievable, but not surprising. Up to now I
think most users do not have a need to touch group policy settings. However,
with Vista Microsoft is relying more heavily on group policy settings for
Vista configuration settings.  
 
Does anyone know a method for accessing group policies specific for Vista. 
 
Dave
 

----- Original Message ----- 
From: Darren  <mailto:darren@xxxxxxxxxx> Mar-Elia 
To: gptalk@xxxxxxxxxxxxx 
Sent: Thursday, October 26, 2006 10:07 AM
Subject: [gptalk] Re: Can Group Policy Settings be accessed and set from an
application

Generally speaking, you can't do this. There is no API that will get you
access to all GP settings. Part of the problem here is that each CSE that MS
ships contains its own mechanism for writing and storing settings, with
their own formats. So, there is no unified API that provides the single
interface.
 
Not a great answer, but one that I've been repeating since about 1999 :).
Maybe one day it will get solved.
 
Darren

  _____  

From: gptalk-bounce@xxxxxxxxxxxxx [mailto:gptalk-bounce@xxxxxxxxxxxxx] On
Behalf Of Webmaster eSupport
Sent: Thursday, October 26, 2006 6:57 AM
To: gptalk@xxxxxxxxxxxxx
Subject: [gptalk] Can Group Policy Settings be accessed and set from an
application


Hello All,
 
I have an application where I need to manage group policy settings from an
application. I'm new to Group Policies in Windows, have been reading
everything I can find but so far I've not definitive methods which enable
group policy settings to be read and configured from a C++ application.
Seems to me that if group policies can be configured with Windows group
policy editor, it must be possible to implement my own application. 
 
Appreciate any help anyone can provide to get me up to speed on this. 
 
Thanks in advance,
 
Dave

Other related posts: