Skip to content

Instantly share code, notes, and snippets.

@azure365pro
Created May 13, 2020 17:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azure365pro/f39879453e65c3659b0fc9e6f502de63 to your computer and use it in GitHub Desktop.
Save azure365pro/f39879453e65c3659b0fc9e6f502de63 to your computer and use it in GitHub Desktop.
Create Bulk Mailboxes in Random for Lab Purposes or Student Exams in Exchange Server
<#
-Creating Custom Mailboxes for Lab Purposes
I created a simple Script with a Loop
-So You Enter a Number of mailboxes you want
-Also You enter how the Mailboxes name should start with
-And Enter the password you needed for those accounts and it does creates for you
.Author
Written By: Satheshwaran Manoharan
#>
$numberofMailboxes = Read-Host "Enter the Number of Mailboxes you want"
$EnterPrefix = Read-Host "Enter the Prefix of the Account"
$GettingPassword = Read-Host "Enter the Password for the accounts"
$Password = Convertto-SecureString "$GettingPassword" -Asplaintext -Force
$GettingEmailSuffix = "((Get-AcceptedDomain)[0]).Name"
$mail = "@"+"$GettingEmailSuffix"
For($i=0;$i -le $numberofMailboxes;$i++)
{
$UPN = "$EnterPrefix"+"$i"+"$mail"
$Name = "$EnterPrefix"+"$i"
New-Mailbox -Name $Name -Alias $Name -UserPrincipalName $Upn -Password $Password
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment