Active Directory Multiple User Create Script

ADDS Related Scripts
User avatar
Site Admin
Posts: 17
Joined: Mon Jun 17, 2019 2:19 pm

Active Directory Multiple User Create Script

Postby hamid Tue Jun 18, 2019 1:17 pm

Hello Club!

PowerShell comes into play again! Here is a simple PowerShell Script which helps you to create multiple user account at the same time.

$Name = Read-Host "Enter Name"
$LastName = Read-Host "Enter Last Name"
$UserName = Read-Host "Enter Username"
$Password = Read-Host -AsSecureString "Enter Password"
New-ADUser -name $Name -GivenName $Name -Surname $LastName -SamAccountName Mail$UserName -AccountPassword $Password -UserPrincipalName $ -Path ",DC=vargonentech,DC=com" -Enabled $true
New-ADUser -name $Name -GivenName $Name -Surname $LastName -SamAccountName $UserName -AccountPassword $Password -UserPrincipalName $UserName@vargonentech.local -Path "OU=vargonentech.local,DC=vargonentech,DC=com" -Enabled $true
Import-Module 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto -ClientApplication:ManagementShell
Enable-mailbox -Identity $

Enjoy! :geek:
Microsoft MVP: Cloud and Datacenter Management

Return to “Active Directory”

Who is online

Users browsing this forum: No registered users and 1 guest