tailieunhanh - Active Directory Cookbook for windows server 2003- P15

Active Directory Cookbook for windows server 2003- P15:If you are familiar with the O'Reilly Cookbook format that can be seen in other popular books, such as the Perl Cookbook, Java Cookbook, and DNS and BIND Cookbook, then the layout of this book will not be anything new to you. The book is composed of 18 chapters, each containing 10-30 recipes for performing a specific Active Directory task. Within each recipe are four sections: problem, solution, discussion, and see also. | See Also Recipe for information on LDIF RFC 2849 The LDAP Data Interchange Format LDIF Technical Specification and MS KB 237677 Using LDIFDE to Import and Export Directory Objects to Active Directory Recipe Exporting Objects to a CSV File Problem You want to export objects to a comma-separated variable CSV file. The CSV file can then be opened and manipulated from a spreadsheet application or with a text editor. Solution Using a command-line interface csvde -f -l AttrList -p Scope -r Filter -d BaseDN Discussion Once you have a CSV file containing entries you can use a spreadsheet application such as Excel to view sort and manipulate the data. Using a command-line interface The parameters used by cvsde are nearly identical to those used by ldifde. The -f switch specifies the name of the file to use to save the entries to -s is the DC to query -1 is the comma-separated list of attributes to include -p is the search scope base onelevel or subtree -r is the search filter and -d is the base DN. If you encounter any issues the -v switch enables verbose mode and can help identify problems. See Also Recipe for importing objects using a CSV file Recipe Importing Objects Using a CSV File Problem You want to import objects into Active Directory using a CSV file. Solution Using a command-line interface 151 To import objects using the csvde utility you must first create a CSV file containing the objects to add. The first line of the file should contain a comma-separated list of attributes you want to set with dn being the first attribute. Here is an example DN objectClass cn sn userAccountControl sAMAccountName userPrincipalName The rest of the lines should contain entries to add. If you want to leave one of the attributes unset then leave the value blank followed by a comma . Here is a sample CSV file that would add two user objects DN objectClass sn userAccountControl .