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:
Example: -e "G:\Exports\Settings\My Export.ini"
Example of INI file contents:
[SETTINGS] CONTAINER=CN=Users,DC=MADSolutions,DC=com
INCLUDESUBCONTAINERS=NO OVERWRITEEXPORTFILE=YES
Additional examples:
[SETTINGS] CONTAINER=CN=Users,DC=MADSolutions,DC=com
INCLUDESUBCONTAINERS=YES 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 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]
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 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 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 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:
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 OVERWRITEEXPORTFILE=YES
[CONDITIONS] CONDITION1=cinvalid;co;MADSolutions
Condition: “the Active Directory attribute value is in the incorrect format”
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 OVERWRITEEXPORTFILE=YES
[CONDITIONS] CONDITION1=cformat;extensionAttribute3;%2#%
The full command line for importing objects with the Directory Mate console is:
Example: -i "G:\Imports\Settings\My Import.ini"
Example of INI file contents:
[SETTINGS]
IMPORTFILE=G:\Imports\My Import.csv
The following command line flags are optional and only apply if you are creating new Active Directory users with 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
[SETTINGS]
IMPORTFILE=C:\My Imports\Import.csv
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
Copyright
MADSolutions®, A division of |