DAPI_PARMS

The DAPI_PARMS structure contains a set of common parameters that are applied to directory calls during the directory session.

Quick Info

Header file: DAPI.H
Unicode: Yes

typedef struct
{
  DWORD        dwDAPISignature;
  DWORD        dwFlags;
  LPTSTR       pszDSAName;
  LPTSTR       pszBasePoint;
  LPTSTR       pszContainer;
  LPTSTR       pszNTDomain;    
  LPTSTR       pszCreateTemplate;
  PDAPI_ENTRY  pAttributes;
}  DAPI_PARMS, *PDAPI_PARMS, *LPDAPI_PARMS;
 

Members

dwDAPISignature
Set this value to DAPI_SIGNATURE.
dwFlags
Defined values that control directory operations. Use the bitwise OR operator (|) to enable multiple operations. If you set one of this first group of flags in DAPIStart, you cannot change them in DAPIWrite:
DAPI_MODIFY_REPLACE_PROPERTIES
Overwrites any existing properties when modifying. If this flag is not specified, the imported file’s data is appended to any existing data associated with the property.
DAPI_CREATE_NT_ACCOUNT
Creates a Windows NT security account whenever a mailbox is created. The Windows NT security account password must be changed on the next logon (the first time the newly created account is used). If a Windows NT account for the user already exists, a warning is posted and the existing account is not changed, but an attempt is still made to create a mailbox. Windows NT account creation is only attempted when a mailbox object is being created in the directory.

This flag is ignored when importing custom recipients and distribution lists. The function sets the ASSOC-NT-ACCOUNT property (or attribute) to be that of the Windows NT user if the account creation occurred without error. If ASSOC-NT-ACCOUNT is specified in the import file, this value is used instead of the name of the newly created user. The account will be created in the Windows NT Security Domain specified in the pszNTDomain parameter, unless overridden in the Assoc-NT-Account property value, such as seattle\dougie.

This flag implies DAPI_RESTRICT_ACCESS.

DAPI_CREATE_RANDOM_PASSWORD
Generates random passwords for newly created Windows NT accounts. If this flag is specified, the function creates a password of random uppercase and lowercase characters of a length equal to the minimum required password length for the Windows NT Server domain. The account name and password will be written into the password file. A password of at least four characters is generated if the minimum password length is less then or equal to four.

If this flag is not set, the password is constructed using the account name and padded with Xs to meet the minimum required password length.

DAPI_DELETE_NT_ACCOUNT
When deleting a mailbox, the Windows NT Account named by the mailbox property Assoc-NT-Account will be deleted if this flag is set. If the account does not exist, a warning will be logged, but mailbox deletion will proceed.
DAPI_RESTRICT_ACCESS
Applies a Windows NT Server security descriptor to created objects.

Miscellaneous Flags

DAPI_FORCE_SCHEMA_LOAD
Unloads a previously loaded schema and read the schema again. The default action is to reuse the previously loaded schema if it is read from the same messaging site.
DAPI_RAW_MODE
Imports data in raw mode; which means import lines are taken literally. No properties are inherited or constructed. Aliases for property and class names are not recognized.
DAPI_OVERRIDE_CONTAINER
The container specified in the parameter block overrides the contents of the container column. By default, the value specified in the Obj-Container column overrides the container specified in the parameter block.

Flags for DAPIRead

You can also set these flags in DAPIStart. They remain in effect until you override them. If both flags are set, DAPI_READ_ALL_ATTRIBUTES takes precedence.

DAPI_READ_DEFINED_ATTRIBUTES
Returns all attributes that are set for the current object.
DAPI_READ_ALL_ATTRIBUTES
Returns all attributes that are defined for the class of the current object.

Flags that control event filtering:

DAPI_EVENT_MIN
Logs only start and stop messages, but not warning or error messages.
DAPI_EVENT_SOME
Logs start, stop, and error messages.
DAPI_EVENT_ALL
Logs start, stop, error, and warning messages.
pszDSAName
The computer name of the directory service agent from which to export objects. You can use MAPI function calls to determine this name. See the MAPI Programmer’s Reference for more information.

If NULL, the function attempts to find a directory service agent on the local computer and use its name. Otherwise, the function broadcasts for servers and uses the name that is returned as a result of the broadcast.

pszBasePoint
The distinguished name (DN) of the messaging site or DN of the container that serves as the basepoint in the directory information tree for bulk operations. The basepoint is the point in the directory information tree under which the calling application will perform bulk-object creation or manipulation operations. See BatchExport for an explanation of what occurs when this value is either NULL or an empty string (““).
pszContainer
The DN or relative distinguished name (RDN) of the default container where the bulk operation begins. If this member is NULL, the directory functions assume that the container is below the level indicated by the pszBasePoint member. If this member is an RDN, the directory functions assume that the container is relative to the level indicated by the pszBasePoint member. The container name in the import file can override this value.
pszNTDomain
The name of the primary Windows NT Server domain in which to create or find Windows NT accounts. If this parameter is NULL, the function uses the primary Windows NT Server domain name (the domain on which the executing process’s machine account is logged on). If Windows NT accounts are being created, it is best to specify an actual value for this parameter (that it not be NULL).
pszCreateTemplate
A DN (or RDN) of the user object that serves as the template for creating new user objects. If this member is an RDN, the directory functions use the pszBasePoint and pszContainer members to determine the path to the template. If this member is NULL, the directory functions do not use a template when creating new user objects.
pAttributes
Points to a DAPI_ENTRY structure containing the names of attributes used in the session’s DAPIRead and DAPIWrite function calls. If this member is NULL, DAPIRead and DAPIWrite use attributes passed as arguments.

Note In DAPIStart, the value of the pAttributes member takes precedence over any conflicting dwFlags member values.

Remarks

The DAPI_PARMS structure is a parameter to the DAPIStart function.

For an example of how to initialize the DAPI_PARMS structure, look at the code just before the DAPIStart function call in the DIRSYNC.C code sample.

See Also

BEXPORT_PARMS, BIMPORT_PARMS, DAPI_ENTRY, DAPIStart