PS - Create Exchange Test Mailboxes

The following will create 10 test mailboxes with the password entered in the secure string prompt:


$password = Read-Host "Enter password" -AsSecureString

New-Mailbox -UserPrincipalName TestMBX1@domain.local -Alias TestMBX1 -Name TestMBX1 -Password $password -Firstname Test -LastName MBX1 -DisplayName "TestMBX1"
New-Mailbox -UserPrincipalName TestMBX2@domain.local -Alias TestMBX2 -Name TestMBX2 -Password $password -Firstname Test -LastName MBX2 -DisplayName "TestMBX2"
New-Mailbox -UserPrincipalName TestMBX3@domain.local -Alias TestMBX3 -Name TestMBX3 -Password $password -Firstname Test -LastName MBX3 -DisplayName "TestMBX3"
New-Mailbox -UserPrincipalName TestMBX4@domain.local -Alias TestMBX4 -Name TestMBX4 -Password $password -Firstname Test -LastName MBX4 -DisplayName "TestMBX4"
New-Mailbox -UserPrincipalName TestMBX5@domain.local -Alias TestMBX5 -Name TestMBX5 -Password $password -Firstname Test -LastName MBX5 -DisplayName "TestMBX5"
New-Mailbox -UserPrincipalName TestMBX6@domain.local -Alias TestMBX6 -Name TestMBX6 -Password $password -Firstname Test -LastName MBX6 -DisplayName "TestMBX6"
New-Mailbox -UserPrincipalName TestMBX7@domain.local -Alias TestMBX7 -Name TestMBX7 -Password $password -Firstname Test -LastName MBX7 -DisplayName "TestMBX7"
New-Mailbox -UserPrincipalName TestMBX8@domain.local -Alias TestMBX8 -Name TestMBX8 -Password $password -Firstname Test -LastName MBX8 -DisplayName "TestMBX8"
New-Mailbox -UserPrincipalName TestMBX9@domain.local -Alias TestMBX9 -Name TestMBX9 -Password $password -Firstname Test -LastName MBX9 -DisplayName "TestMBX9"
New-Mailbox -UserPrincipalName TestMBX10@domain.local -Alias TestMBX10 -Name TestMBX10 -Password $password -Firstname Test -LastName MBX10 -DisplayName "TestMBX10"

Comments