Earlier Chapter also introduced you to Comma-Separated Values #Data Exchange (CSVDE) , which imports data from comma-separated values (.csv) files. It also exports data to a .csv file.
The following example shows a .csv file that will create a group, Marketing, and populate the group with two initial members, Linda Mitchell and Scott Mitchell.
“CN=Linda Mitchell,OU=User Accounts,DC=contoso,DC=com;
CN=Scott Mitchell,OU=User Accounts,DC=contoso,DC=com”
The .csv file is two lines. The first line contains the attribute names, and the second line contains the values for the new group, Marketing. The second line is wrapped for presentation
in this text.
Take note of the use of quotation marks in the preceding example. Quotation marks are required when an attribute includes a comma; without quotation marks, the comma would be interpreted as a delimiter. The DN of the group includes commas, so it must be surrounded by quotation marks. In the case of a multivalued attribute such as member, each value is separated by a semicolon—there are two values in member in the example. The entire member attribute is surrounded by quotation marks, not each individual value of the member attribute.
You can import this file into Active Directory by using the command:
csvde -i -f “filename” [-k]
The -i parameter specifies import mode. Without it, CSVDE uses export mode. The -f parameter
precedes the filename, and the -k parameter ensures that processing continues even if errors are encountered, such as if the object already exists or the member cannot be found.
Note: CSVDE can be used to create objects, but not to modify existing objects. You cannot use
CSVDE to import members to existing groups.