Step 2: Configure the PowerShell Scriptīelow is the script to bulk import new users. I like to keep the name of the headers the same as the new-aduser parameters, it makes it easier to troubleshoot.Īt this point, you should have a CSV file configured, and save the file to your local computer. To add more I recommend looking at the PowerShell new-aduser cmdlet to see which parameters are supported. I’ve included several common user fields in the CSV template and PowerShell script. Just know that whatever columns you add to the CSV you will also need to include them in the PowerShell script. You may want to include some additional user fields in the CSV. The OU path is the distinguishedName attribute, to find this open up Active Directory Users and Computers and browse to the OU you want to import to, then right click and select properties then select attribute editor.Ĭopy the path into the path column in the CSV file.Īt this point the CSV file has the required fields, you can jump to step 2 (setting up the PowerShell script) or keep reading to configure optional fields for user accounts.Īdd additional user fields to the CSV file. If you leave it blank it will import into the default users container. This is the distinguished name of the OU. path = OU where you want to import users to.Make sure it meets your password requirements. SamAccountName = this will be the users logon name.Technically you can import new accounts with just the SamAccountName, Name, and the password column but that is not recommended. Rights to create users accounts in Active DirectoryĪ basic CSV file should have the following headers.PowerShell Active Directory Module loaded – The script I provide will load the module you just need to run it from a computer that has RSAT tools installed or the AD role.Method 2: How to Bulk Import AD Users With PowerShell from a CSV file Try the GUI Bulk Import tool for FREE, download your copy here. This is a huge time saver for when you need to mass update user information such as department, telephone number, email addresses, and so on. The AD Pro Toolkit also includes a tool for bulk updating AD user accounts. Plus you don’t have to modify any scripts or need PowerShell experience. The GUI tool is a huge time saver and makes importing user accounts into Active Directory super easy. I’ll check the Marketing folder to verify the accounts imported into the correct OU. Yes! It worked, it created the account and set all the user attributes from the CSV file. Next, I’ll open an account and verify all properties were set. It only took 30 seconds to import 100 user accounts. You can also see an error in red letting me know a group cold not be found. You can see below the logs show imported 100 users out of 100. When the import is complete you can view the logs to verify the import status. The next step is to select your import options, then select your template and click run. When you have your CSV template ready just save it and move to step 4. Here is a screenshot of my CSV file (click to enlarge). In this example, I’m going to import 100 users, add the users to multiple security groups, add a manager for each user, and set 30 other attributes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |