Export (0) Print
Expand All

DsListRoles function

The DsListRoles function lists roles recognized by the server.

Syntax


DWORD DsListRoles(
  _In_   HANDLE hDs,
  _Out_  PDS_NAME_RESULTW *ppRoles
);

Parameters

hDs [in]

Contains a directory service handle obtained from either the DSBind or DSBindWithCred function.

ppRoles [out]

Pointer to a variable that receives a pointer to a DS_NAME_RESULT structure containing the roles the server recognizes. The returned structure must be deallocated using DsFreeNameResult.

The indexes of the array in the DS_NAME_RESULT structure indicate what data are contained by each array element. The following constants may be used to specify the desired index for a particular piece of data.

ValueMeaning
DS_ROLE_DOMAIN_OWNER

Server owns the domain.

DS_ROLE_INFRASTRUCTURE_OWNER

Server owns the infrastructure.

DS_ROLE_PDC_OWNER

Server owns the PDC.

DS_ROLE_RID_OWNER

Server owns the RID.

DS_ROLE_SCHEMA_OWNER

Server owns the schema.

 

Return value

If the function returns a list of roles, the return value is NO_ERROR.

If the function fails, the return value can be one of the following error codes.

Individual name conversion errors are reported in the returned DS_NAME_RESULT structure.

Return codeDescription
ERROR_INVALID_PARAMETER

A parameter is invalid.

ERROR_NOT_ENOUGH_MEMORY

There is insufficient memory available.

 

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Ntdsapi.h

Library

Ntdsapi.lib

DLL

Ntdsapi.dll

Unicode and ANSI names

DsListRolesW (Unicode) and DsListRolesA (ANSI)

See also

Domain Controller and Replication Management Functions
DS_NAME_RESULT
DsFreeNameResult

 

 

Show:
© 2014 Microsoft