In daily ad management and maintenance, creating accounts for users is the most common work, but if you want to create hundreds of users and groups, or one day the boss said he wanted to see how many users and groups in the ad, need you to guide a copy of the data, then what? Microsoft has provided us with csvde this tool to complete these operations, the following:
?
- Refers to creating a user account
Creating a new Excel table contains at least the following fields, where the userAccountControl value is 514, which means that the initial state of the new account is disabled.
After organizing the Excel table above to save the Users.csv upload to domain control, use the domain administrator to execute the following command to import the user.
Csvde-i-F C:\users.csv
After the import is successful, the account is disabled, save the following command as the reset Password.bat file, run it once, and then select all the accounts to enable it right-click.
?
- Bulk export of user information
Csvde-f exportusers.csv-d "ou=test,dc=domainname,dc=com"-R "(& (Objectcategory=person) (Objectclass=user))"
- Create groups in batches
method is similar to creating a user, a new Excel table that contains the following fields, where GroupType is 8, represents a distribution group, and 4 is a security group
Save the table as Groups.csv upload to domain control and use the domain administrator to import the following command.
Csvde-i-F C:\groups.csv
?
- Export group Information
Use the following command to export all groups.
Csvde-f c:\exportgroups.csv-d "dc=domainname,dc=com"-R "(& (Objectcategory=group) (objectclass=*))"
How to create/export user accounts and groups in bulk using CSVDE