-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sample script to generate 1000 mailboxes quickly. Tested with
Microsoft Exchange 2007.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
######################################### | ||
#### Automatically create mailboxes ##### | ||
######################################### | ||
|
||
### define the password to use for all mailboxes | ||
$password = Read-Host "Enter Password" -AsSecureString | ||
|
||
### define the template username portion to use | ||
$user = "user" | ||
|
||
### define the FQDN | ||
$fqdn = "exchange2007.local" | ||
|
||
### database | ||
$database = "First Storage Group\Mailbox Database" | ||
|
||
### OrganizationalUnit | ||
$ou = "exchange2007.local/Users" | ||
|
||
### define start ($i) and end ($end) | ||
$i = 1 | ||
$end = 1000 | ||
|
||
|
||
################## DO NOT EDIT FROM HERE ####################### | ||
|
||
do { | ||
|
||
$upn = $user + $i + "@" + $fqdn | ||
$name = $user + $i | ||
|
||
new-mailbox -Password $password -Database $database -UserPrincipalName $upn -Name $name -OrganizationalUnit $ou; | ||
$i++; | ||
|
||
} while ($i -le $end) |