IGroupPolicyObject::GetName method (gpedit.h)

The GetName method retrieves the unique GPO name.

For Active Directory policy objects, the method returns a GUID. For a local GPO, the method returns the string "Local". For remote objects, GetName returns the computer name.

Syntax

HRESULT GetName(
  [out] LPOLESTR pszName,
  [in]  int      cchMaxLength
);

Parameters

[out] pszName

Pointer to a buffer that receives the GPO name.

[in] cchMaxLength

Specifies the size, in characters, of the pszName buffer.

Return value

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

Remarks

To retrieve the display name for a GPO, you can call the GetDisplayName method.

Requirements

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

See also

GetDisplayName

Group Policy Interfaces

Group Policy Overview

IGroupPolicyObject