If you use the ad graphic interface to create a large number of user accounts, it will waste a lot of time to repeat the same steps. Users can use the csvde.exe1_ldifde.exe1_dsadd.exe and other programs in the system to save time for creating user accounts.
Csvde.exe:
You can use it to add user accounts (or other types of objects), but you cannot use it to modify or delete user accounts. You should first use the publisher to create user account data into the pure account file, and then use csvde.exe to import these user accounts into the ad database at one time.
Ldifde.exe:
You can use it to add, delete, and modify user accounts (or other types of objects ). You should first use the publisher to create user account data into the pure account file, and then use ldifde.exe to import these user accounts into the ad database at one time.
Dsadd.exe+dsmod.exeand dsrm.exe:
Dsadd.exeused to modify the user account (or other objects, dsmod.exeused to modify the user account, and dsrm.exe used to delete the user account. You need to create a batch file, and then use the three programs to add, modify, or delete the user account to create the batch file.
For the csvde.exeand ldifde.exe programs, you must first use a program that can edit plain text files (such as NotePad) to create user account data into the file. Before creating a file, see the following instructions:
1. You must specify where the user account is created, that is, you must specify the storage path (distinguished name, DN ).
2. The object type, such as user, must be included.
3. the user logon name must be included (Windows native ).
4. the user logon name (that is, user principal name, UPN) should be included ).
5. It may contain other user information, such as phone numbers and addresses.
6. the user's password cannot be set.
7. Since the created user account has no password, it is recommended to disable this user account.
Use csvde.exe to add user accounts:
We will use the example to describe how to create a file for csvde.exe. The content of this file is as follows:
DN, objectclass, samaccountname, userprincipalname, displayname, useraccountcontrol
"Cn = Wang xiaoxi, ou = Shanghai, ou = business department, Dc = Benet, Dc = com", user, Dennis, [email protected], Wang xiaoxi, 514
"Cn = Zhang zhonghu, ou = Shanghai, ou = Development Department, Dc = Benet, Dc = com", user, Steve, [email protected], Zhang zhonghu, 514
The preceding attribute data starting with "cn =..." is the attribute data of a user account, which is separated by commas. A row starting with dn is used to define each attribute corresponding to the row starting with CN.
DN indicates the following "cn = Wang xiaoxi, ou = Shanghai, ou = business department, Dc = Benet, Dc = com", that is, the storage path.
Objectclass indicates the object type, which can be user or group.
Samaccountname indicates the User Login Name (native Windows2000 ).
Userprincipalname indicates the User Logon Name (UPN ).
Diplayname indicates the display name.
Useraccountcontrol indicates whether to disable the account, 514 indicates disabled, and 512 indicates enabled.
After creating a file, open the Command Prompt window. Then run the command to name the file user.txt and the file is in the C: \ test Folder:
Csvde-I-f c: \ test \ user.txt
Use ldifde.exe to add, modify, and delete user accounts:
This example describes how to create a file for ldifde.exe. The content of this file is as follows:
DN: Cn = "Lin Chao Xia", ou = Shanghai, ou = business department, Dc = Benet, Dc = com
Changetype: add
Objectclass: User
Samaccountname: John
Userprincipalname: [email protected]
Displayname: Lin chaoxia
Useraccountcontrol: 514
DN: Cn = Zhang zhonghu, ou = Shanghai, ou = Development Department, Dc = Benet, Dc = com
Changetype: Delete
DN: Cn = Chen Dahai, ou = Shanghai, ou = business department, Dc = Benet, Dc = com
Changetype: Modify
Replace: aamaccountname
Samaccountname: Robert
-
Replace: userprincipalname
Userprincipalname: [email protected]
The preceding two attributes indicate adding a user account, deleting a user account, and modifying a user account. Pay attention to the following issues:
1. There must be at least one empty line between the two pieces of data.
2. When modifying attribute data, each attribute must end with a minus sign.
If other accounts need to be added at the end of the file, enter at least one row after the minus sign. During saving, Zookeeper selects unicode. if no value is used, ldifde.exe cannot recognize Chinese characters correctly, and the Chinese characters imported into the ad Database become garbled characters.
After the file is edited, open the command line to run the command. The file name is user.txt, and the file is in the C: \ test Folder:
Ldifde-I-f c: \ test \ user.txt
To import data to the specified domain controller, add the "-s" parameter, for example:
Ldifde-s dc1.benet.com-I-f c: \ test \ user.txt
Use programs such as dsadd.exe to add, modify, and delete user accounts:
The following uses notepad to describe how to create a batch file and input the dsadd, dsmod, and dsrm commands to the file, and use them to add, modify, and delete user accounts. The file content is roughly as follows:
Dsadd user "cn = Xu Yuanchi, ou = Shanghai, ou = business department, Dc = Benet, Dc = com"-Samid Bob-UPN [email protected]-display Xu Yuchi-disabled Yes
Dsmod user "cn = Wang xiaoxi, ou = Shanghai, ou = business department, Dc = Benet, Dc = com"-UPN [email protected]-PWD 111 aaaa-Tel 27654321
Dsrm "cn = Li Xiaoyang, ou = Shanghai, ou = business department, Dc = Benet, Dc = com"-noprompt
Pause
Note:
The dsadd command is used to add a user account located in "cn = Xu Yuanchi, ou = Shanghai, ou = business department, Dc = Benet, Dc = com, -Samid Bob is used to set his "User Login Name (earlier than Windows2000)" to Bob, and-UPN [email protected] to set his "User Login Name" to [email protected]. "-display Xu Yuchi" is used to set its display name to Xu Yuchi. "-disabled yes" indicates that this account is disabled.
The dsmod command is used to modify the user account located in "cn = Wang xiaoxi, ou = Shanghai, ou = business department, Dc = Benet, Dc = com, "-UPN [email protected]" is used to change its "User Login Name" to [email protected], and "-PWD 111aaaa" is used to set the account password, "-Tel 27654321" is used to set the user's phone number.
This article is from the "Sean" blog, please be sure to keep this source http://chengfuxing.blog.51cto.com/5168625/1555165
Add multiple user accounts at the same time