Create Multiple Users In Active Directory Using PowerShell

Following my new Active Directory PowerShell weekly series and the article I published Yesterday, today I’ll show you how to create multiple users In Active Directory using the AD PowerShell Module.

The first thing you need Is to create a .CSV file with as seen below:

Copy the .CSV file to a Domain Controller and run the code below from PowerShell ISE or from the PowerShell console:

Import-Csv C:\Files\users.csv | foreach{New-ADUser -Name $_.name -Surname $_.surname -GivenName $_.givenname -UserPrincipalName $_.UserPrincipalName -AccountPassword `

(ConvertTo-SecureString -AsPlainText "Password1234" -Force) -Enabled $true -Verbose}

Once done, You will see the users In AD as seen below:

If you run Get-Aduser with one of the newly created users you will see the details:

Don’t forget to visit my other Weekly Series like Docker Basics and Office 365 PowerShell.

Leave a Reply