IGroupPolicyObject::GetDSPath method

The GetDSPath method retrieves the Active Directory path to the root of the specified GPO section.

Syntax


HRESULT GetDSPath(
  [in]   DWORD dwSection,
  [out]  LPOLESTR pszPath,
  [in]   int cchMaxPath
);

Parameters

dwSection [in]

Specifies the GPO section. This parameter can be one of the following values.

ValueMeaning
GPO_SECTION_ROOT

Root section

GPO_SECTION_USER

User section

GPO_SECTION_MACHINE

Computer section

 

pszPath [out]

Pointer to a buffer that receives the path, in ADSI format (LDAP://cn=user, ou=users, dc=coname, dc=com).

cchMaxPath [in]

Specifies the maximum number of characters that can be stored in the pszPath 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

If you call the GetDSPath method and specify a computer GPO, the method succeeds, but on return, the pszPath parameter contains an empty string. This is because computer GPOs do not have Active Directory storage; they have only file system storage.

To retrieve the file system path to the root of a GPO section, you can call the GetFileSysPath method.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Gpedit.h

DLL

Gpedit.dll

IID

IID_IGroupPolicyObject is defined as EA502723-A23D-11d1-A7D3-0000F87571E3

See also

Group Policy Overview
Group Policy Interfaces
IGroupPolicyObject
GetPath
GetFileSysPath

 

 

Show:
© 2014 Microsoft