Directory Mate  

     Console Usage...


Directory Mate includes a console application that allows you to perform all of the same functions as the full wizard application.  This allows to put together your own scheduled or batch Directory Mate operations.  The console application is named "DMConsole.exe" and can be found with the other product files or through the Start menu under "MADSolutions...Directory Mate...Console".

Each of the command line functions uses an INI file for configuration.  Settings for the INI files are given below.
 


 

Exporting

 

The full command line for exporting objects with the Directory Mate console is:


-e <full path to the INI file containing the settings>

 

Example: 

-e "G:\Exports\Settings\My Export.ini"

 

Example of INI file contents:

 

[SETTINGS]

CONTAINER=CN=Users,DC=MADSolutions,DC=com

INCLUDESUBCONTAINERS=NO
CLASS=user
ATTRIBUTES=displayName%givenName%sn%department%company
EXPORTFILE=G:\Exports\My Export.csv

OVERWRITEEXPORTFILE=YES

 
CONTAINER This item should specify the distinguished name of the Active Directory container where you want to export.
Example: "OU=Accounting Office,OU=Departments,DC=MADSolutions,DC=com"
INCLUDESUBCONTAINERS If this value is set to YES then objects in all of the subcontainers will also be exported.
CLASS This item should specify the LDAP name of the object class you want to export.  You can only specify one class per export. 
ATTRIBUTES This item should specify the LDAP names of the attributes you want to export separated by %.
Do not specify the distinguishedName or objectGUID attributes, they will automatically be included in your export file.
EXPORTFILE This item should specify the full path to the export file you want to create. This file must have the csv extension.
OVERWRITEEXPORTFILE If this value is set to to YES then the export file will be overwritten if it already exists.  If this value is set to NO and the export file already exists then an error will be generated.

 

Additional examples:


1. Exporting the display name, first name and last name of users in the default "Users" container, including subcontainers:

[SETTINGS]

CONTAINER=CN=Users,DC=MADSolutions,DC=com

INCLUDESUBCONTAINERS=YES
CLASS=user
ATTRIBUTES=displayName%givenName%sn
EXPORTFILE=c:\Exports\Users.csv

OVERWRITEEXPORTFILE=YES

 

2. Exporting the display name of groups from the organizational unit "Groups/Section A", not including subcontainers:

[SETTINGS]

CONTAINER=OU=Section A,OU=Groups,DC=MADSolutions,DC=com

INCLUDESUBCONTAINERS=NO
CLASS=group
ATTRIBUTES=displayName
EXPORTFILE=c:\Exports\Groups.csv

OVERWRITEEXPORTFILE=YES

 

Command Line Export Conditions

 

Conditions may be added to your command line that allow you to search through the directory for users that do not meet specific directory information conditions. 

 

There are three types of conditions and you may add as many of them as required.  When multiple conditions are processed they are taken to have an "AND" condition between them.

 

Conditions must be placed in the INI file in a section with the heading [CONDITIONS].  Conditions must be numbered, starting with CONDITION1.

 

Example:

[CONDITIONS]
CONDITION1=cempty;department
CONDITION2=cempty;company
OPERATOR=OR

 

This example shows two conditions, finding objects that have an empty department attribute or that have an empty company attribute. 

 

The OPERATOR value allows you to specify if the conditions should have an OR between them or an AND between them.  If you do not specify this value then AND is assumed.

 

Condition: “the Active Directory attribute value is blank”

 

Condition usage: cempty;<attribute>

 

For example, if you want to only include users in your export file that have an empty display name, you would use the following for a condition line:

cempty;displayName

 

Example of a full INI file for exporting the display name, first name and last name of users in the default "Users" container, including subcontainers.  Only users with an empty displayName value will be exported:

 

[SETTINGS]

CONTAINER=CN=Users,DC=MADSolutions,DC=com

INCLUDESUBCONTAINERS=YES
CLASS=user
ATTRIBUTES=displayName%givenName%sn
EXPORTFILE=c:\Exports\Users.csv

OVERWRITEEXPORTFILE=YES

 

[CONDITIONS]

CONDITION1=cempty;displayName

 

You may add more than one of these conditions.  For example if you wanted to export users that have an empty displayName and an empty department, you would add the following to your INI file:

 

[CONDITIONS]

CONDITION1=cempty;displayName

CONDITION2=cempty;department

OPERATOR=AND

 

Condition: “the Active Directory attribute value is not blank”

 

Condition usage: cnotempty;<attribute>

 

For example, if you want to only include users in your export file that do not have an empty company name, you would use the following for a condition line:

cnotempty;company

 

Example of a full INI file for exporting the display name, first name and last name of users in the default "Users" container, including subcontainers.  Only users with a company value that is not empty will be exported:

 

[SETTINGS]

CONTAINER=CN=Users,DC=MADSolutions,DC=com

INCLUDESUBCONTAINERS=YES
CLASS=user
ATTRIBUTES=displayName%givenName%sn%company
EXPORTFILE=c:\Exports\Users.csv

OVERWRITEEXPORTFILE=YES

 

[CONDITIONS]

CONDITION1=cnotempty;company

 

 

Condition: “the Active Directory attribute contains the following value(s)” 

 

This condition will check the specified attribute value against a list that you provide.  Any users who have one of the required values will match the condition.

 

Condition usage: cvalid;<attribute>;<list of valid values separated by %>

 

For example, if you want to only include users in your export file that have the value "Accounting" or "Tech" in their department field, you would use the following for a condition line:

cvalid;department;Accounting%Tech

 

Example of a full INI file for exporting the display name, first name and last name of users in the default "Users" container, including subcontainers.  Only users that have the value "MADSolutions" in their company field will be exported:

 

[SETTINGS]

CONTAINER=CN=Users,DC=MADSolutions,DC=com

INCLUDESUBCONTAINERS=YES
CLASS=user
ATTRIBUTES=displayName%givenName%sn
EXPORTFILE=c:\Exports\Users.csv

OVERWRITEEXPORTFILE=YES

 

[CONDITIONS]

CONDITION1=cvalid;co;MADSolutions

 

Condition: “the Active Directory attribute does not contain the following value(s)” 

 

This condition will check the specified attribute value against a list that you provide.  Any users who do not have one of the required values will match the condition.

 

Condition usage: cinvalid;<attribute>;<list of valid values separated by %>

 

For example, if you want to only include users in your export file that do not have the value "Accounting" or "Tech" in their department field, you would use the following for a condition line:
cinvalid;department;Accounting%Tech

 

Example of a full INI file for exporting the display name, first name and last name of users in the default "Users" container, including subcontainers.  Only users that do not have the value "MADSolutions" in their company field will be exported:

 

[SETTINGS]

CONTAINER=CN=Users,DC=MADSolutions,DC=com

INCLUDESUBCONTAINERS=YES
CLASS=user
ATTRIBUTES=displayName%givenName%sn
EXPORTFILE=c:\Exports\Users.csv

OVERWRITEEXPORTFILE=YES

 

[CONDITIONS]

CONDITION1=cinvalid;co;MADSolutions

 

Condition: “the Active Directory attribute value is in the incorrect format”


This condition will check the specified field value to ensure that it matches the format that you provide.  This is useful for ensuring that users have entered valid values into their fields.

 

Condition usage: cformat;<attribute>;<format>

 

The format condition and how it operates is described in more detail in the Directory Mate Export help file

 

For example, if you want to only include users in your export file that do not have a 5 digit zip code, you would use the following for a condition line:

cformat;postalCode;%5#%

 

Example of a full INI file for exporting the display name, first name and last name of users in the default "Users" container, including subcontainers.  Only users that do not have a 2 digit code in the field extensionAttribute3 will be included:

 

[SETTINGS]

CONTAINER=CN=Users,DC=MADSolutions,DC=com

INCLUDESUBCONTAINERS=YES
CLASS=user
ATTRIBUTES=displayName%givenName%sn
EXPORTFILE=c:\Exports\Users.csv

OVERWRITEEXPORTFILE=YES

 

[CONDITIONS]

CONDITION1=cformat;extensionAttribute3;%2#%

 

Importing

 

The full command line for importing objects with the Directory Mate console is:


-i <full path to the INI file containing the settings>

 

Example: 

-i "G:\Imports\Settings\My Import.ini"

 

Example of INI file contents:

 

[SETTINGS]

IMPORTFILE=G:\Imports\My Import.csv
ERRORFOLDERPATH=G:\Imports\Errors\
OVERWRITEATTRIBUTES=YES
CREATEMAILBOXES=NO
DISABLEDACCOUNTS=NO
PASSWORDNEVEREXPIRES=NO
PASSWORDMUSTCHANGE=YES

 
IMPORTFILE This item should specify the full path to your import file.
Example: "C:\Active Directory\Imports\My Import.csv"
The file must have the csv extension.
ERRORFOLDERPATH This item should specify the folder you want to use to store a file containing errors that occurred during the import.
Example: "C:\Active Directory\Import Errors\"
This value is optional.  If you do not specify the folder then Directory Mate will use the same file folder as your import file to store the error file.
If no errors occur during processing of your import file then no error file is created.
OVERWRITEATTRIBUTES This flag is optional and only applies if you are importing any attributes that contain multiple values.  If this flag is specified then it means you want to overwrite the values of that attribute with the values in your import file.  If you do not specify this flag, then it means that value in your import file will be appended to the values that already exist for the attribute.

 

The following command line flags are optional and only apply if you are creating new Active Directory users with your import file:

 
CREATEMAILBOXES This flag means Directory Mate should create Microsoft Exchange mailboxes for each new user that is created. 
DISABLEDACCOUNTS This flag means Directory Mate should disable the new user accounts that are created.  If this flag is not specified then new users that are created will be enabled.
PASSWORDNEVEREXPIRES This flag means Directory Mate should turn on the option "Password never expires" for new user accounts that it creates.
PASSWORDMUSTCHANGE This flag means Directory Mate should turn on the option "User must change password at next logon" for new user accounts that it creates.  For this flag to work you must include a "password" column in your import file.

 

Examples:
 

1. Importing the file C:\My Imports\Import.csv using the same file folder, "C:\My Imports" for any error file that is created:

 

[SETTINGS]

IMPORTFILE=C:\My Imports\Import.csv


2. Importing the file C:\My Imports\Import.csv using the file folder "C:\Import Errors\" for any error file that is created:

 

[SETTINGS]

IMPORTFILE=C:\My Imports\Import.csv
ERRORFOLDERPATH=C:\Import Errors\

 

Registering

 

The full command line for importing objects with the Directory Mate console is:

 

-r <full path to the INI file containing the settings>

 

Example of INI file contents:

 

[SETTINGS]

FOREST=NO

SERIALCODE=222-aaa-111

ACTIVATIONCODE=111111-aaaaaa-222222-bbbbbb

DOMAIN=FiveAlarm.com

 

Note: Any registration that is made will register both the console version and the wizard version of Directory Mate.  You do not need to register the same domain in both applications.

 

FOREST

SERIALCODE

ACTIVATIONCODE

DOMAIN

 
-r This flag is required and tells the console application that you want to register a domain.
FOREST This setting is optional and tells Directory Mate that you want to register an entire forest.  Do not specify YES for this setting unless you have purchased a forest license from MADSolutions.
SERIALCODE This item should list the serial code that was given to you by MADSolutions.  Example: 222-aaa-111
DOMAIN This item should list the domain that you are registering.  It must be the same domain that you gave to MADSolutions.  Example: "FiveAlarm.com"
ACTIVATIONCODE This item should list the activation code that was given to you by MADSolutions.  Example: 111111-aaaaaa-222222-bbbbbb

 

Copyright MADSolutions®, A division of
Geisel Envisioning International Ltd.,
A Canadian corporation.