Page 1 of 1

Active Directory Multiple User Create Script

Posted: Tue Jun 18, 2019 1:17 pm
by hamid
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: