Tuesday, November 24, 2015

Using LDIF to Modify All Objects in the Marketing OU


In this example, the entire Marketing organization has moved to a new office address. You use LDIF to perform a batch modification for all user objects in the Marketing organization by altering the state, street, locality, and postal code attributes.
To modify all objects in the Marketing OU
  1. Click Start, point to Programs, then point to Accessories, and click Command Prompt.
  2. At the command prompt, type the following command to extract the required entries:
    ldifde -f marketing.ldf -s hq-res-dc-01-d"ou=Marketing,dc= reskit,dc=com"-psubtree–r"(objectCategory=CN=Person,CN=Schema,CN=Configuration,DC=reskit,DC=com)" –l "l,st,streetAddress, postalCode"
  3. Use a text editor such as Notepad to edit the LDIF file, Marketing.ldf. (Save the file as an .ldf file.) Modify each entry so that it is similar to that shown in Figure 2 below.
    Bb727091.bulkst02(en-us,TechNet.10).gif
    Figure 2: Editing attributes for a move
  4. Run LDIFDE to import the modifications into Active Directory. At the command prompt, type the following command, and then press > Enter. (See Figure 3 below.)
    ldifde –i -f marketing.ldf -s hq-res-dc-01
    Bb727091.bulkst03(en-us,TechNet.10).gif
    Figure 3: Importing modifications into the Active Directory
  5. To confirm that the entries have been modified, check the Active Directory Users and Computers snap-in. (For help with using this snap-in, see the Step-by-Step Guide to Managing the Active Directory. )
For further information on using LDIFDE, type LDIFDE /? at the command prompt.
Note: Another utility called CSVDE performs the same export functions as LDIFDE, but uses a comma-separated file format. Import operations with CSVDE are "add" only, and CSVDE does not offer the ability to modify or delete objects. The CSV file format is supported by applications such as Microsoft Excel.

No comments:

Post a Comment