Platform SDK: Group Policy

CreateGPOLink

The CreateGPOLink function creates a link between the specified GPO and the specified site, domain, or organizational unit.

HRESULT CreateGPOLink(
  LPOLESTR lpGPO,
  LPOLESTR lpContainer,
  BOOL fHighPriority
);

Parameters

lpGPO
[in] Specifies the Active Directory path to the GPO.
lpContainer
[in] Specifies the Active Directory path to the site, domain, or organizational unit.
fHighPriority
[in] Specifies the link priority. If this parameter is TRUE, the system creates the link as the highest priority. If this parameter is FALSE, the system creates the link as the lowest priority.

Return Values

If the function succeeds, the return value is S_OK. Otherwise, the function returns one of the COM error codes defined in the Platform SDK header file WinError.h.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Gpedit.h.
  Library: Use Userenv.lib.

See Also

Group Policy Overview, Group Policy Functions, DeleteGPOLink