Bulk import account in AD domain

Source: Internet
Author: User
Tags microsoft help
One, demand raises

There is a demand for work, the need to bulk import some accounts, and asked for some attributes, such as: Department, position, extension and so on.

In fact, the demand is very simple, the solution is very simple, but in the actual operation process, also did appear some problems, GG and BD Some, but also see some other people's blog content, but most of them are relatively similar, and even directly copy the Microsoft Help and Support Center template, and there is no actual operation of the case of the explanation, and operation considerations, according to its blog operation, there will always be such a problem. In this, although this article is very simple, but I still want to write out and share with you, sharing is not only the actual solution, but also the intention to be responsible for careful attitude,

When we get this demand, we might ask, where do I get these attributes? I can't remember so many attribute values. In fact, we can also be flexible, we can export, and then based on the exported file to compare these attribute values can be completed, below let us look at the process.

Second, the environment description

1,DC (2003 system, installed with Office 2007)

2, the domain name is: tt.com

3, a OU:TT was established and a user was established under the TT OU: Alice

Third, use CSVDE export account

Microsoft defaults to providing two batch import export tools, namely CSVDE (CSV directory exchange) and LDIFDE (LDAP Data Interchange Format Directory Exchange), the specific choice of the above tool depends on the task to be completed. If you need to create an object, you can use either CSVDE or LDIFDE, and if you need to modify or delete an object, you must use LDIFDE. We choose Csvde here.

1, open cmd, change directory to C packing directory, convenient for us to find files, such as Figure 1,

Csvde–f user. CSV exports the Ad object to a file named User.csv, and the-f switch represents the name of the output file that follows.

  

Figure 1

2, the above information is very large, from the figure can be seen 200 items, so there will be too much interference with some of our information, not convenient for us to find what we want, we can appropriately add a little parameter to export the information we want most, as shown in Figure 2,

Csvde–f user1.csv–d "ou=tt,dc=tt,dc=com" description: TT this OU and user Alice (some of the attributes of this user have been filled out by me, such as position, Department, extension, etc., what attributes are required to fill in related items, But in order to better effect can fill in English, because the Chinese after the export will appear garbled, of course, in the export time, after adding a parameter –u can also be solved, but in the later we edit the time is not convenient, so try to use English as a template is I to export the attribute values we need to build, this does not matter, Just to export a template for a property value, let's refer to it. From the diagram we can see that only 2 items were exported this time, which is much clearer than the last one. Of course, there are a lot of csvde parameters, but we can not use a lot of, want to know more can play. "To view, or refer to the official website: (v=ws.10)

  

Figure 2

Four, edit the template

Based on the information from the previous step, we can find what we need: position, Department, extension, etc. the attribute value of the information, respectively, is "Title,department,telephonenumber", in fact, there is a trick is that we can directly modify this CSV file, There's no need to go new. We take other unwanted deletions and leave only what we need, as Figure 3,

  

Figure 3

Five, import user

Open cmd, replace to c packing directory, use command to import, as shown in Figure 4

Csvde–i–f User2.csv-i is the meaning of the import, F is the meaning of the specified file

  

Figure 4

Six, because the tool can not import the password directly, and we use in the import of 514, this is the meaning of the lock account, the user's password is empty, and the next time the user login needs to change the password. This is obviously unsafe, as shown in Figure 5,

  

Figure 5

Seven, enable the account and set the initial password.

1, because the current user is a null password, our Default Domain policy is demanding complexity, so we can not enable users, we first change the password, because the user is more, manually to change the trouble, the tool is not allowed to import passwords, so we could use a bat file to change the user, as shown in Figure 6, After the establishment of the Save as Pwd.bat, open cmd switch to the C root directory to run, see the results of the completion.

  

Figure 6

2, and then, using shift for multiple selections, right-click to select Enable user. As shown in Figure 7

  

Figure 7

Eight, see if the results meet your needs

We open a user to see if the position, department, or extension exists, as shown in Figure 8

  

Nine, summary

When we are importing, not to say that all the accounts belong to an OU, then we need to add your corresponding OU before the import, this is a prerequisite, otherwise in the import will be an error. Another tool is LDIFDE, in fact, I personally feel the same, interested can refer to the official website: (v=ws.10)

From the above point of view, in fact, some things are not very difficult, but I would like to do not want to do, to experiment, to sum up. I hope we can learn and progress together and discuss together.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.