Shows how to add bulk users to Active Directory with some attributes.
Import-Module ActiveDirectory
$Users = Import-Csv users.csv
foreach ($User in $Users)
{
$Displayname = $User.Displayname
$UserFirstname = $User.Firstname
$UserLastname = $User.Lastname
$OU = $User.OU
$SAM = $User.samaccountname
$UPN = $User.mail
$Department = $User.Department
$Title = $User.Title
$Description = $User.Title
$Password = $User.Password
$PSEmailServer = $User.mail
New-ADUser -Name $Displayname -DisplayName $Displayname -EmailAddress $PSEmailServer -SamAccountName $SAM -UserPrincipalName $UPN -GivenName $UserFirstname -Surname $UserLastname -Description $Description -Title $Title -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -Path $OU -ChangePasswordAtLogon $false –PasswordNeverExpires $true
}
On this page of the site you can watch the video online How to create multiple AD Users from a csv file using PowerShell Script. with a duration of hours minute second in good quality, which was uploaded by the user Fun & Tech 15 February 2022, share the link with friends and acquaintances, this video has already been watched 628 times on youtube and it was liked by 5 viewers. Enjoy your viewing!