IGPMSOM::CreateGPOLink method (gpmgmt.h)

Links the specified GPO to the specified position in the list of GPOs that are linked to a particular SOM. If another GPO link occupies the specified position, the method inserts the new link ahead of the older link, and moves the older link, and all subsequent links in the list, down by one.

Syntax

HRESULT CreateGPOLink(
  [in]  long        lLinkPos,
  [in]  IGPMGPO     *pGPO,
  [out] IGPMGPOLink **ppNewGPOLink
);

Parameters

[in] lLinkPos

Position in which the GPO should be linked. The position is 1-based. If this parameter is – 1, the GPO is appended to the end of the list. If the position specified is greater than the current number of GPO links, the method fails and returns E_INVALIDARG.

[in] pGPO

GPO to link.

[out] ppNewGPOLink

Address of a pointer to the IGPMGPOLink interface.

Return value

C++

Returns S_OK if successful. Returns a failure code if an error occurs.

JScript

Returns a reference to a GPMGPOLink object.

VB

Returns a reference to a GPMGPOLink object.

Remarks

Attempting to link a GPO to a particular SOM multiple times causes the method to fail with ERROR_ALREADY_EXISTS.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header gpmgmt.h
DLL Gpmgmt.dll

See also

IGPMGPO

IGPMGPOLink

IGPMSOM