Created
May 13, 2020 17:16
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
-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