DeleteGPOLink function (gpedit.h)

The DeleteGPOLink function deletes the link between the specified GPO and the specified site, domain, or organizational unit.

Syntax

GPEDITAPI HRESULT DeleteGPOLink(
  [in] LPOLESTR lpGPO,
  [in] LPOLESTR lpContainer
);

Parameters

[in] lpGPO

A value that specifies the path to the GPO, in ADSI format (LDAP://cn=user, ou=users, dc=coname, dc=com). You cannot specify a server name in this parameter.

[in] lpContainer

Specifies the Active Directory path to the site, domain, or organizational unit.

Return value

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

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header gpedit.h
Library Gpedit.lib
DLL Gpedit.dll

See also

CreateGPOLink

DeleteAllGPOLinks

Group Policy Functions

Group Policy Overview