2012 AD-CSVDE add users in batch
1. Create the TXT file and save it in C:\
. Because the password policy of the domain requires length and complexity, and the password cannot be included in notepad, the imported user must be disabled, so the value of userAccountControl is set to 514, and the imported user is disabled. 512 is enabled
DN,objectClass,samAccountName,userPrincipalName,displayName,userAccountControl
"CN= Zhang San, OU= Finance Department, DC=test,DC=com", user,user10,user10@test.com, Zhang San, 514
"CN= Li Si, OU= Finance Department, DC=test,DC=com", user,user11,user11@test.com, Li Si, 514
two,
3. Output the result in C:\:
Connect to "(null)"
Log in with SSPI as the current user
Import directories from the "c:\ aduser.txt" file
Load entry
2: CN= Zhang San, OU= Finance Department, DC=test,DC=com
Attribute 0) objectClass: user
Attribute 1) samAccountName: user10
Attribute 2) userPrincipalName: user10@test.com
Attribute 3) displayName: Zhang San
Attribute 4) userAccountControl: 514
The project was modified successfully.
3: CN= Li Si, OU= Finance Department, DC=test,DC=com
Attribute 0) objectClass: user
Attribute 1) samAccountName: user11
Attribute 2) userPrincipalName: user11@test.com
Attribute 3) displayName: Li Si
Attribute 4) userAccountControl: 514
The project was modified successfully.
2 entries were successfully modified.
Command completed successfully
-
4. Modify the user password in batches:
Enter the following in notepad, change the extension to bat, and execute the batch:
Net user user10 123 please visit QWE
Net user user11 123 please visit QWE
5. Enable the account in batch (failed if the password is empty)