• Home
  • About us
  • Contact
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Welcome to www.DoitFixit.com

www.doitfixit.com

  • Microsoft
  • Fortinet
  • Symantec
  • Office 365
  • Azure
  • Others
  • Show Search
Hide Search

Bulk/Multiple Users in Active Directory Step by Step Guide

March 23, 2013 By Damitha Anuradha 1 Comment

Before proceed with the user creation create the OU structure in Active Directory Users and Computers snapin and Password Policy.

Create a CSV file that include Organization Users with specific attributes to be imported in the Active Directory. See below example template of mine.

If you want to split User’s name you can use below Excel formula.
To get first name from a cell =LEFT(A2,FIND(“.”,A2,1))
To get last name from a cell =RIGHT(A2,LEN(A2)-FIND(“.”,A2,1))

 

Active Directory User Creation Template

{attachments}

Save the excel file as CSV (Comma delimited) and copy in to Active Directory Server.


Open Active Directory Module for Windows PowerShell from Administrative Tools.


Change the powershell path. Run below script. (change the CSV file name and domain name)

Import-Csv .\DOITFIXITUsers.csv | foreach-object { $userprinicpalname = $_.SamAccountName + “@doitfixit.local“; New-ADUser -SamAccountName $_.SamAccountName -UserPrincipalName $userprinicpalname -Name $_.name -DisplayName $_.name -GivenName $_.cn -SurName $_.sn -Department $_.Department -Path $_.path; Set-ADAccountPassword -identity $_.SamAccountName -NewPassword (ConvertTo-SecureString -AsPlainText $_.Password -Force) -Reset ; Enable-ADAccount -identity $_.SamAccountName; Set-ADUser -Identity $_.SamAccountName -ChangePasswordAtLogon $true}

 

-SamAccountName $_.SamAccountName
-UserPrincipalName $userprinicpalname
-Name $_.name
-DisplayName $_.name
-GivenName $_.cn
-SurName $_.sn
-Department $_.Department
-Path $_.path
-ChangePasswordAtLogon
: Damitha
: damitha@doitfixit.local
: Damitha Anuradha
: Damitha Anuradha
: Damitha
: Anuradha
: Engineering
: OU=Users,OU=Production,DC=doitfixit,DC=local
: Enable User must change Password at Next Log on option

e.g. To add Description value insert -Description $_.description in to the command line.

Reader Interactions

Comments

  1. Ibrahim says

    September 13, 2015 at 2:40 am

    I still don’t believe it if I am dreaming or I really was able to import bulk users in few minutes where tools like solarwinds and other open source just failed BIG TIME and I spent around 3 hours so far until I came across and this page was my last try before going to sleep in midnight. Thank you very much, God bless you for all your efforts creating this step by step page. Its AWESOME.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Recent Posts

  • Veeam Backup – Failed to prepare guests for volume snapshot
  • How to Configure/Integrate FortiClient EMS with FortiAnalyzer
  • Backup Hyper-V Virtual Machines with Pass-Through Disks
  • Slow Network Speed with Hyper-V Virtual Machines on Windows Server Server 2019
  • Block MS Exchange Server OWA access from Internet
  • Error 1168 – The specified product key could not be validated.
  • Unable to Enable Desktop Icons after Joining to the Domain
  • Veritas BackupExec – A backup set was created which contains no data 0xe00084b7
  • Download Offline Address Book – Unexpected Error has occurred
  • WSUS 4 Console crash – Connection Error

Deprecated: genesis_footer_creds_text is deprecated since version 3.1.0! Use genesis_pre_get_option_footer_text instead. This filter is no longer supported. You can now modify your footer text using the Theme Settings. in /home/wwwdoitf/public_html/wp-includes/functions.php on line 5238