Active Directory ( AD ) Mass New User Creation from CSV, FILE or LIST

Active Directory ( AD ) Mass New User Creation from CSV or LIST example

Imports users from a csv ( excel file saved as msdos text csv )

Fields names in the excel file should be: sam, upn, notes, password

There are lots of fields to automate under the new-aduser command-let, you can look these and add as needed.

*basic example

Source:

$MyDC = "dc01.domain.com"
$containerDN = "OU=STAFF,DC=domain,DC=com"

#MSDOS Csv file, with columns: sam,upn,notes,password
$myusers = Import-Csv -Path ".\myuserlist.csv"

foreach ($user in $myusers) {
     New-ADUser -Path $containerDN  -SamAccountName $user.sam -EmailAddress $user.upn -UserPrincipalName $user.upn -description $user.notes -AccountPassword (ConvertTo-SecureString ($user.password).trim() -AsPlainText -Force) -Organization "Super Company Name ORG" -Company "Super Company" -Country "US" -Enabled $true -Server $MyDC -ErrorAction Continue 
}