Adding multiple users to AD from CSV

Download script here


– Powershell 2.0

– CSV file

Attributes Used:

  • FirstName
  • LastName
  • City
  • Department
  • Job Title
  • Logon Name
  • Password
  • Description
  • E-Mail
  • Script (Logon Script)
  • H drive (Logon file share letter)
  • domain name

PS1 script:

Function Provision {


Write-Host $_.samAccountName



Function ProvisionInputCSV {

Param ([string]$filename)

$users = Import-CSV C:powershellusers.csv

foreach ($user in $users) {

$ht = @{‘givenName’=$user.”First Name”;

‘sn’= $user.”Last Name”;

‘title’= $user.”Job Title”;

‘department’= $user.Department;

‘displayName’= $user.”First Name” + ” ” + $user.”Last Name”;

‘city’= $user.”City”;

‘password’= $user.Password;

‘samAccountName’= $user.”Logon Name”;

‘description’= $user.”Description”;

‘mail’= $user.”E-Mail”;

‘scriptPath’= $user.script;

‘homeDrive’= $user.”H drive”;

‘userPrincipalName’= $user.”domain name”


Write-Output $ht



ProvisionInputCSV c:powershellusers.csv | Provision

This script is using the following

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s