Copilot + PowerShell: Add Bulk AD Users in One Go! Import users list from excel/txt

Опубликовано: 06 Май 2026
на канале: Raymond Roshan
53
1

Hi all,

In this video I have used copilot to create multiple user accounts in Active Directory in one go.
You just need to ask specific question and copilot will give you similar script but yes you need to modify as per your requirement too.

Below is the script I have used.


Load required modules
Import-Module ActiveDirectory

Define domain and OU path
$domain = "Roshan.raymond.com"
$ouPath = "OU=Child Delhi Users,DC=Roshan,DC=raymond,DC=com"

Path to Excel file
$excelPath = "C:\Scripts\DelhiUsers.csv"

Import user data from Excel
$users = Import-Csv -Path "C:\Scripts\DelhiUsers.csv"


Create users in AD
foreach ($user in $users) {
$securePassword = ConvertTo-SecureString $user.Password -AsPlainText -Force
$userPrincipalName = "$($user.Username)@$domain"
$displayName = "$($user.FirstName) $($user.LastName)"

New-ADUser `
-Name $displayName `
-GivenName $user.FirstName `
-Surname $user.LastName `
-SamAccountName $user.Username `
-UserPrincipalName $userPrincipalName `
-AccountPassword $securePassword `
-Path $ouPath `
-Enabled $true `
-ChangePasswordAtLogon $true
}


=====================================================================================

Add multiple computer objects in Active directory using simple powershell script
Video link
   • Add multiple computer objects in Active di...  

Create multiple users in AD using Powershell script | Copy the Script from description
Video link
   • Create multiple users in AD using Powershe...  

Links
Connect with me:
Instagram: instagram.com/raymond_roshan
Facebook: facebook.com/profile.php?id=61561439954717
X: x.com/RAYMONDROSHAN
Whatsapp: whatsapp.com/channel/0029Va8nvQLI1rchgjES8n3C