Platform SDK: Group Policy

GROUP_POLICY_OBJECT

The GROUP_POLICY_OBJECT structure provides information about a GPO in a GPO list.

typedef struct _GROUP_POLICY_OBJECT {
   DWORD    dwOptions; 
   DWORD    dwVersion; 
   LPCTSTR  lpDSPath; 
   LPCTSTR  lpFileSysPath; 
   LPCTSTR  lpDisplayName; 
   TCHAR    szGPOName[50];
   GPO_LINK GPOLink;
   LPARAM   lParam;
   struct   _GROUP_POLICY_OBJECT *pNext;
   struct   _GROUP_POLICY_OBJECT *pPrev;
   LPTSTR   lpExtensions;
   LPARAM   lParam2;
   LPTSTR   lpLink;
}  GROUP_POLICY_OBJECT, *PGROUP_POLICY_OBJECT;

Members

dwOptions
Specifies link options. This parameter can be one of the following values.
Value Meaning
GPO_FLAG_DISABLE This GPO is disabled.
GPO_FLAG_FORCE Do not override the settings in this GPO with settings in a subsequent GPO.

dwVersion
Specifies the version number of the GPO.
lpDSPath
Pointer to a string that specifies the path to the directory service portion of the GPO.
lpFileSysPath
Pointer to a string that specifies the path to the file system portion of the GPO.
lpDisplayName
Pointer to the display name of the GPO.
szGPOName
Pointer to a string that specifies a unique name that identifies the GPO.
GPOLink
Specifies the link information for the GPO. This parameter may be one of the following values.
Value Meaning
GPLinkUnknown No link information is available.
GPLinkMachine The GPO is linked to a computer (local or remote).
GPLinkSite The GPO is linked to a site.
GPLinkDomain The GPO is linked to a domain.
GPLinkOrganizationalUnit The GPO is linked to an organizational unit.

lParam
User-supplied data.
pNext
Pointer to the next GPO in the list.
pPrev
Pointer to the previous GPO in the list.
lpExtensions
Extensions that have stored data in this GPO. The format is a string of GUIDs grouped in brackets. For more information, see the following Remarks section.
lParam2
User-supplied data.
lpLink
Path to the Active Directory site, domain, or organization unit to which this GPO is linked. If the GPO is linked to the local GPO, this member is "Local".

Remarks

Each GPO could contain data that must be processed by multiple snap-in extensions. Therefore, lpExtensions is organized as a series of GUIDs based on snap-in extension. The data format is as follows:

[ext_guid1, snap_in_guid1, snap_in_guid2, ...] 
[ext_guid2, snap_in_guid3, snap_in_guid4, ...] 

First, there is an opening bracket, "[", followed by the GUID of the extension. Next, you'll find one or more GUIDS of the snap-in extensions that have put data in the GPO. After the last snap-in GUID, there is a closing bracket, "]". This pattern is repeated for the next extension.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Userenv.h.
  Unicode: Declared as Unicode and ANSI structures.

See Also

Group Policy Overview, Group Policy Structures, GetGPOList, FreeGPOList