ntdsapi.h header

This header is used by multiple technologies. For more information, see:

ntdsapi.h contains the following programming interfaces:

Functions

 
DsAddSidHistoryA

Retrieves the primary account security identifier (SID) of a security principal from one domain and adds it to the sIDHistory attribute of a security principal in another domain in a different forest. (ANSI)
DsAddSidHistoryW

Retrieves the primary account security identifier (SID) of a security principal from one domain and adds it to the sIDHistory attribute of a security principal in another domain in a different forest. (Unicode)
DsBindA

Binds to a domain controller. (ANSI)
DsBindByInstanceA

Explicitly binds to any AD LDS or Active Directory instance. (ANSI)
DsBindByInstanceW

Explicitly binds to any AD LDS or Active Directory instance. (Unicode)
DsBindingSetTimeout

The DsBindingSetTimeout function sets the timeout value that is honored by all RPC calls that use the specified binding handle. RPC calls that required more time than the timeout value are canceled.
DsBindToISTGA

Binds to the computer that holds the Inter-Site Topology Generator (ISTG) role in the domain of the local computer. (ANSI)
DsBindToISTGW

Binds to the computer that holds the Inter-Site Topology Generator (ISTG) role in the domain of the local computer. (Unicode)
DsBindW

Binds to a domain controller. (Unicode)
DsBindWithCredA

Binds to a domain controller using the specified credentials. (ANSI)
DsBindWithCredW

Binds to a domain controller using the specified credentials. (Unicode)
DsBindWithSpnA

Binds to a domain controller using the specified credentials and a specific service principal name (SPN) for mutual authentication. (DsBindWithSpnA)
DsBindWithSpnExA

Binds to a domain controller using the specified credentials and a specific service principal name (SPN) for mutual authentication. (DsBindWithSpnExA)
DsBindWithSpnExW

Binds to a domain controller using the specified credentials and a specific service principal name (SPN) for mutual authentication. (DsBindWithSpnExW)
DsBindWithSpnW

Binds to a domain controller using the specified credentials and a specific service principal name (SPN) for mutual authentication. (DsBindWithSpnW)
DsClientMakeSpnForTargetServerA

Constructs a service principal name (SPN) that identifies a specific server to use for authentication. (ANSI)
DsClientMakeSpnForTargetServerW

Constructs a service principal name (SPN) that identifies a specific server to use for authentication. (Unicode)
DsCrackNamesA

Converts an array of directory service object names from one format to another. (ANSI)
DsCrackNamesW

Converts an array of directory service object names from one format to another. (Unicode)
DsFreeDomainControllerInfoA

The DsFreeDomainControllerInfo function frees memory that is allocated by DsGetDomainControllerInfo for data about the domain controllers in a domain. (ANSI)
DsFreeDomainControllerInfoW

The DsFreeDomainControllerInfo function frees memory that is allocated by DsGetDomainControllerInfo for data about the domain controllers in a domain. (Unicode)
DsFreeNameResultA

Frees the memory held by a DS_NAME_RESULT structure. (ANSI)
DsFreeNameResultW

Frees the memory held by a DS_NAME_RESULT structure. (Unicode)
DsFreePasswordCredentials

Frees memory allocated for a credentials structure by the DsMakePasswordCredentials function.
DsFreeSchemaGuidMapA

Frees memory that the DsMapSchemaGuids function has allocated for a DS_SCHEMA_GUID_MAP structure. (ANSI)
DsFreeSchemaGuidMapW

Frees memory that the DsMapSchemaGuids function has allocated for a DS_SCHEMA_GUID_MAP structure. (Unicode)
DsFreeSpnArrayA

Frees an array returned from the DsGetSpn function. (ANSI)
DsFreeSpnArrayW

Frees an array returned from the DsGetSpn function. (Unicode)
DsGetDomainControllerInfoA

Retrieves data about the domain controllers in a domain. (ANSI)
DsGetDomainControllerInfoW

Retrieves data about the domain controllers in a domain. (Unicode)
DsGetSpnA

The DsGetSpn function constructs an array of one or more service principal names (SPNs). Each name in the array identifies an instance of a service. These SPNs may be registered with the directory service (DS) using the DsWriteAccountSpn function. (ANSI)
DsGetSpnW

The DsGetSpn function constructs an array of one or more service principal names (SPNs). Each name in the array identifies an instance of a service. These SPNs may be registered with the directory service (DS) using the DsWriteAccountSpn function. (Unicode)
DsInheritSecurityIdentityA

Appends the objectSid and sidHistory attributes of SrcPrincipal to the sidHistory of DstPrincipal and then deletes SrcPrincipal, all in a single transaction. (ANSI)
DsInheritSecurityIdentityW

Appends the objectSid and sidHistory attributes of SrcPrincipal to the sidHistory of DstPrincipal and then deletes SrcPrincipal, all in a single transaction. (Unicode)
DsListDomainsInSiteA

Lists all the domains in a site. (ANSI)
DsListDomainsInSiteW

Lists all the domains in a site. (Unicode)
DsListInfoForServerA

The DsListInfoForServer function lists miscellaneous data for a server. (ANSI)
DsListInfoForServerW

The DsListInfoForServer function lists miscellaneous data for a server. (Unicode)
DsListRolesA

The DsListRoles function lists roles recognized by the server. (ANSI)
DsListRolesW

The DsListRoles function lists roles recognized by the server. (Unicode)
DsListServersForDomainInSiteA

Lists all the servers in a domain in a site. (ANSI)
DsListServersForDomainInSiteW

Lists all the servers in a domain in a site. (Unicode)
DsListServersInSiteA

Lists all the servers in a site. (ANSI)
DsListServersInSiteW

Lists all the servers in a site. (Unicode)
DsListSitesA

Lists all the sites in the enterprise forest. (ANSI)
DsListSitesW

Lists all the sites in the enterprise forest. (Unicode)
DsMakePasswordCredentialsA

Constructs a credential handle suitable for use with the DsBindWithCred function. (ANSI)
DsMakePasswordCredentialsW

Constructs a credential handle suitable for use with the DsBindWithCred function. (Unicode)
DsMapSchemaGuidsA

Converts GUIDs of directory service schema objects to their display names. (ANSI)
DsMapSchemaGuidsW

Converts GUIDs of directory service schema objects to their display names. (Unicode)
DsQuerySitesByCostA

Gets the communication cost between one site and one or more other sites. (ANSI)
DsQuerySitesByCostW

Gets the communication cost between one site and one or more other sites. (Unicode)
DsQuerySitesFree

Frees the memory allocated by the DsQuerySitesByCost function.
DsRemoveDsDomainA

Removes all traces of a domain naming context from the global area of the directory service. (ANSI)
DsRemoveDsDomainW

Removes all traces of a domain naming context from the global area of the directory service. (Unicode)
DsRemoveDsServerA

The DsRemoveDsServer function removes all traces of a directory service agent (DSA) from the global area of the directory service. (ANSI)
DsRemoveDsServerW

The DsRemoveDsServer function removes all traces of a directory service agent (DSA) from the global area of the directory service. (Unicode)
DsReplicaAddA

Adds a replication source reference to a destination naming context. (ANSI)
DsReplicaAddW

Adds a replication source reference to a destination naming context. (Unicode)
DsReplicaConsistencyCheck

Invokes the Knowledge Consistency Checker (KCC) to verify the replication topology.
DsReplicaDelA

Removes a replication source reference from a destination naming context (NC). (ANSI)
DsReplicaDelW

Removes a replication source reference from a destination naming context (NC). (Unicode)
DsReplicaFreeInfo

Frees the replication state data structure allocated by the DsReplicaGetInfo or DsReplicaGetInfo2 functions.
DsReplicaGetInfo2W

Retrieves replication state data from the directory service. This function allows paging of results in cases where there are more than 1000 entries to retrieve.
DsReplicaGetInfoW

Retrieves replication state data from the directory service.
DsReplicaModifyA

Modifies an existing replication source reference for a destination naming context. (ANSI)
DsReplicaModifyW

Modifies an existing replication source reference for a destination naming context. (Unicode)
DsReplicaSyncA

Synchronizes a destination naming context (NC) with one of its sources. (ANSI)
DsReplicaSyncAllA

Synchronizes a server with all other servers, using transitive replication, as necessary. (ANSI)
DsReplicaSyncAllW

Synchronizes a server with all other servers, using transitive replication, as necessary. (Unicode)
DsReplicaSyncW

Synchronizes a destination naming context (NC) with one of its sources. (Unicode)
DsReplicaUpdateRefsA

Adds or removes a replication reference for a destination from a source naming context. (ANSI)
DsReplicaUpdateRefsW

Adds or removes a replication reference for a destination from a source naming context. (Unicode)
DsReplicaVerifyObjectsA

Verifies all objects for a naming context with a source. (ANSI)
DsReplicaVerifyObjectsW

Verifies all objects for a naming context with a source. (Unicode)
DsServerRegisterSpnA

The DsServerRegisterSpn function composes two SPNs for a host-based service. (ANSI)
DsServerRegisterSpnW

The DsServerRegisterSpn function composes two SPNs for a host-based service. (Unicode)
DsUnBindA

The DsUnBind function finds an RPC session with a domain controller and unbinds a handle to the directory service (DS). (ANSI)
DsUnBindW

The DsUnBind function finds an RPC session with a domain controller and unbinds a handle to the directory service (DS). (Unicode)
DsWriteAccountSpnA

Writes an array of service principal names (SPNs) to the servicePrincipalName attribute of a specified user or computer account object in Active Directory Domain Services. (ANSI)
DsWriteAccountSpnW

Writes an array of service principal names (SPNs) to the servicePrincipalName attribute of a specified user or computer account object in Active Directory Domain Services. (Unicode)

Structures

 
DS_DOMAIN_CONTROLLER_INFO_1A

The DS_DOMAIN_CONTROLLER_INFO_1 structure contains data about a domain controller. This structure is returned by the DsGetDomainControllerInfo function. (ANSI)
DS_DOMAIN_CONTROLLER_INFO_1W

The DS_DOMAIN_CONTROLLER_INFO_1 structure contains data about a domain controller. This structure is returned by the DsGetDomainControllerInfo function. (Unicode)
DS_DOMAIN_CONTROLLER_INFO_2A

The DS_DOMAIN_CONTROLLER_INFO_2 structure contains data about a domain controller. This structure is returned by the DsGetDomainControllerInfo function. (ANSI)
DS_DOMAIN_CONTROLLER_INFO_2W

The DS_DOMAIN_CONTROLLER_INFO_2 structure contains data about a domain controller. This structure is returned by the DsGetDomainControllerInfo function. (Unicode)
DS_DOMAIN_CONTROLLER_INFO_3A

The DS_DOMAIN_CONTROLLER_INFO_3 structure contains data about a domain controller. This structure is returned by the DsGetDomainControllerInfo function. (ANSI)
DS_DOMAIN_CONTROLLER_INFO_3W

The DS_DOMAIN_CONTROLLER_INFO_3 structure contains data about a domain controller. This structure is returned by the DsGetDomainControllerInfo function. (Unicode)
DS_NAME_RESULT_ITEMA

The DS_NAME_RESULT_ITEM structure contains a name converted by the DsCrackNames function, along with associated error and domain data. (ANSI)
DS_NAME_RESULT_ITEMW

The DS_NAME_RESULT_ITEM structure contains a name converted by the DsCrackNames function, along with associated error and domain data. (Unicode)
DS_NAME_RESULTA

The DS_NAME_RESULT structure is used with the DsCrackNames function to contain the names converted by the function. (ANSI)
DS_NAME_RESULTW

The DS_NAME_RESULT structure is used with the DsCrackNames function to contain the names converted by the function. (Unicode)
DS_REPL_ATTR_META_DATA

The DS_REPL_ATTR_META_DATA structure is used with the DsReplicaGetInfo and DsReplicaGetInfo2 functions to contain replication state data for an object attribute.
DS_REPL_ATTR_META_DATA_2

The DS_REPL_ATTR_META_DATA_2 structure is used with the DsReplicaGetInfo and DsReplicaGetInfo2 functions to contain replication state data for an object attribute.
DS_REPL_ATTR_META_DATA_BLOB

The DS_REPL_ATTR_META_DATA_BLOB structure is used to contain replication state data for an object attribute.
DS_REPL_ATTR_VALUE_META_DATA

The DS_REPL_ATTR_VALUE_META_DATA structure is used with the DsReplicaGetInfo2 function to provide metadata for a collection of attribute values.
DS_REPL_ATTR_VALUE_META_DATA_2

Used with the DsReplicaGetInfo2 function to provide metadata for a collection of attribute values.
DS_REPL_ATTR_VALUE_META_DATA_EXT

Provides metadata for a collection of attribute replication values.
DS_REPL_CURSOR

The DS_REPL_CURSOR structure contains inbound replication state data with respect to all replicas of a given naming context, as returned by the DsReplicaGetInfo and DsReplicaGetInfo2 functions.
DS_REPL_CURSOR_2

The DS_REPL_CURSOR_2 structure contains inbound replication state data with respect to all replicas of a given naming context, as returned by the DsReplicaGetInfo2 function. This structure is an enhanced version of the DS_REPL_CURSOR structure.
DS_REPL_CURSOR_3W

The DS_REPL_CURSOR_3 structure contains inbound replication state data with respect to all replicas of a given naming context, as returned by the DsReplicaGetInfo2 function.
DS_REPL_CURSOR_BLOB

The DS_REPL_CURSOR_BLOB structure contains inbound replication state data with respect to all replicas of a given naming context.
DS_REPL_CURSORS

The DS_REPL_CURSORS structure is used with the DsReplicaGetInfo and DsReplicaGetInfo2 function to provide replication state data with respect to all replicas of a given naming context.
DS_REPL_CURSORS_2

The DS_REPL_CURSORS_2 structure is used with the DsReplicaGetInfo2 function to provide replication state data with respect to all replicas of a given naming context.
DS_REPL_CURSORS_3W

The DS_REPL_CURSORS_3 structure is used with the DsReplicaGetInfo2 function to provide replication state data with respect to all replicas of a given naming context.
DS_REPL_KCC_DSA_FAILURESW

The DS_REPL_KCC_DSA_FAILURES structure contains an array of DS_REPL_KCC_DSA_FAILURE structures, which in turn contain replication state data with respect to inbound replication partners, as returned by the DsReplicaGetInfo and DsReplicaGetInfo2 functions.
DS_REPL_KCC_DSA_FAILUREW

The DS_REPL_KCC_DSA_FAILURE structure contains replication state data about a specific inbound replication partner, as returned by the DsReplicaGetInfo and DsReplicaGetInfo2 function.
DS_REPL_KCC_DSA_FAILUREW_BLOB

Contains replication state data with respect to a specific inbound replication partner.
DS_REPL_NEIGHBORSW

The DS_REPL_NEIGHBORS structure is used with the DsReplicaGetInfo and DsReplicaGetInfo2 functions to provide inbound replication state data for naming context and source server pairs.
DS_REPL_NEIGHBORW

Contains inbound replication state data for a particular naming context and source server pair, as returned by the DsReplicaGetInfo and DsReplicaGetInfo2 functions.
DS_REPL_NEIGHBORW_BLOB

Contains inbound replication state data for a particular naming context and source server pair.
DS_REPL_OBJ_META_DATA

The DS_REPL_OBJ_META_DATA structure contains an array of DS_REPL_ATTR_META_DATA structures. These structures contain replication state data for past and present attributes for a given object.
DS_REPL_OBJ_META_DATA_2

The DS_REPL_OBJ_META_DATA_2 structure contains an array of DS_REPL_ATTR_META_DATA_2 structures, which in turn contain replication state data for the attributes (past and present) for a given object, as returned by the DsReplicaGetInfo2 function.
DS_REPL_OPW

The DS_REPL_OP structure describes a replication task currently executing or pending execution, as returned by the DsReplicaGetInfo or DsReplicaGetInfo2 function.
DS_REPL_OPW_BLOB

The DS_REPL_OPW_BLOB structure describes a replication task currently executing or pending execution.
DS_REPL_PENDING_OPSW

Contains an array of DS_REPL_OP structures, which in turn describe the replication tasks currently executing and queued to execute, as returned by the DsReplicaGetInfo and DsReplicaGetInfo2 functions.
DS_REPL_QUEUE_STATISTICSW

Used to contain replication queue statistics.
DS_REPL_VALUE_META_DATA

Used with the DS_REPL_ATTR_VALUE_META_DATA structure to contain attribute value replication metadata.
DS_REPL_VALUE_META_DATA_2

Used with the DS_REPL_ATTR_VALUE_META_DATA_2 structure to contain attribute value replication metadata.
DS_REPL_VALUE_META_DATA_BLOB

Used to contain attribute value replication metadata.
DS_REPL_VALUE_META_DATA_BLOB_EXT

Contains attribute value replication metadata.
DS_REPL_VALUE_META_DATA_EXT

Contains attribute replication meta data for the DS_REPL_ATTR_VALUE_META_DATA_EXT structure.
DS_REPSYNCALL_ERRINFOA

The DS_REPSYNCALL_ERRINFO structure is used with the DS_REPSYNCALL_UPDATE structure to contain errors generated by the DsReplicaSyncAll function during replication. (ANSI)
DS_REPSYNCALL_ERRINFOW

The DS_REPSYNCALL_ERRINFO structure is used with the DS_REPSYNCALL_UPDATE structure to contain errors generated by the DsReplicaSyncAll function during replication. (Unicode)
DS_REPSYNCALL_SYNCA

The DS_REPSYNCALL_SYNC structure identifies a single replication operation performed between a source, and destination, server by the DsReplicaSyncAll function. (ANSI)
DS_REPSYNCALL_SYNCW

The DS_REPSYNCALL_SYNC structure identifies a single replication operation performed between a source, and destination, server by the DsReplicaSyncAll function. (Unicode)
DS_REPSYNCALL_UPDATEA

The DS_REPSYNCALL_UPDATE structure contains status data about the replication performed by the DsReplicaSyncAll function. (ANSI)
DS_REPSYNCALL_UPDATEW

The DS_REPSYNCALL_UPDATE structure contains status data about the replication performed by the DsReplicaSyncAll function. (Unicode)
DS_SCHEMA_GUID_MAPA

Contains the results of a call to DsMapSchemaGuids. (ANSI)
DS_SCHEMA_GUID_MAPW

Contains the results of a call to DsMapSchemaGuids. (Unicode)
DS_SITE_COST_INFO

The DS_SITE_COST_INFO structure is used with the DsQuerySitesByCost function to contain communication cost data.

Enumerations

 
DS_KCC_TASKID

Specifies tasks that Knowledge Consistency Checker (KCC) can execute.
DS_NAME_ERROR

The DS_NAME_ERROR enumeration defines the errors returned by the status member of the DS_NAME_RESULT_ITEM structure. These are potential errors that may be encountered while a name is converted by the DsCrackNames function.
DS_NAME_FLAGS

The DS_NAME_FLAGS enumeration is used to define how the name syntax will be cracked. These flags are used by the DsCrackNames function.
DS_NAME_FORMAT

The DS_NAME_FORMAT enumeration provides formats to use for input and output names for the DsCrackNames function.
DS_REPL_INFO_TYPE

The DS_REPL_INFO_TYPE enumeration is used with the DsReplicaGetInfo and DsReplicaGetInfo2 functions to specify the type of replication data to retrieve.
DS_REPL_OP_TYPE

Used to indicate the type of replication operation that a given entry in the replication queue represents.
DS_REPSYNCALL_ERROR

The DS_REPSYNCALL_ERROR enumeration is used with the DS_REPSYNCALL_ERRINFO structure to indicate where in the replication process an error occurred.
DS_REPSYNCALL_EVENT

The DS_REPSYNCALL_EVENT enumeration is used with the DS_REPSYNCALL_UPDATE structure to define which event the DS_REPSYNCALL_UPDATE structure represents.
DS_SPN_NAME_TYPE

The DS_SPN_NAME_TYPE enumeration is used by the DsGetSPN function to identify the format for composing SPNs.
DS_SPN_WRITE_OP

The DS_SPN_WRITE_OP enumeration identifies the type of write operation that should be performed by the DsWriteAccountSpn function.