Syntax

#Enter a path to your import CSV file 

$ADUsers = Import-csv C:\IT\user.csv 

 

 

foreach ($User in $ADUsers) 

{ 

 

       $Username    = $User.username 

       $Password    = $User.password 

       $Firstname   = $User.firstname 

       $Lastname    = $User.lastname 

    $email = $User.email 

       $OU           = $User.ou 

 

       #Check if the user account already exists in AD 

       if (Get-ADUser -F {SamAccountName -eq $Username}) 

       { 

               #If user does exist, output a warning message 

               Write-Warning “A user account $Username has already exist in Active Directory.” 

       } 

       else 

Download Full Script

Purpose:This script can be easily modified as per the parameters you have defined
Modification:-
Type:PowerShell Script (ps1)
Compatibility:Windows
Tags:
Reference link:

Create Bulk Users in Active Directory (Step-By-Step Guide)