Exchange Server 2010 to 2016 Lab #5

Now that we already have our simple Exchange Server 2010 environment, on this Part #5 let us create more mailboxes and send emails to populate our mailboxes.

Before we continue, let’s us review and configure a few more things. Open the Exchange Management Console. Expand Microsoft Exchange On-Premises, you will see: Organization Configuration, Server Configuration, Recipient Configuration, and Toolbox. There, expand Organization Configuration, select Hub Transport, and then click on the Accepted Domains tab.

The Accepted Domains are SMTP domains for which Microsoft Exchange accepts incoming messages. In there you should have your Active Directory Domain listed ( You can add a different Domain if you want to receive messages from a different domain (You would also have to create a send connector and configure your DNS). The Send Connectors tab should be empty right now.

Now, on the right pane expand Server Configuration, select Hub Transport, there under the Receive Connectors tab of your Exchange computer. You will see two connectors created by default. In my case those connectors are Client EXLABEX1 and Default EXLABEX1.

Right-click the Default EXLABEX1, and click on Properties

Click on the Permission Groups tab and check the box for Anonymous users. This will allow your Exchange server to accept incoming mail delivery from remote mail servers.

Finally, expand Recipient Configuration, select Mailbox, you will see the list of mailboxes you have. Now you should have just two users, the admin user (VlabUser) and the Test user.

Creating more Mailboxes

To make the test more realistic we would need more than 2 users. Therefore the next step is to create a list of test-user’s mailboxes. This step will be quite easy as there are many blogs in the internet sharing scripts on how to populate Active Directory with test users, my personal favorite is this blog. So, in my case I use the Fake Name Generator to create a CSV file with the “Given Name”, “Surname” and “Email Address” in it. For your first try I would recommend to use a short list of 10 names for testing, if the test is successful then you can try with more names, the Fake name Generator, allows you to get up to 50,000 names. After requesting the names, you will receive a email with the link to your CSV file with all names.

After receiving the link to the CSV file to your email address download it. You will notice that the email addresses are all with different domains, so the next step is to fix (modify) the email addresses with PowerShell.

Open PowerShell. First we need to import the CSV file, I changed the name of the CSV file I downloaded to FakeName.csv just run the following cmdlet:

#Import CSV file
$data = Import-Csv .\FakeName.csv;

You will see something like:

GivenName Surname    EmailAddress
--------- -------    ------------
Sara      Gregory
Fe        Haugen
Betty     McAllister
Sandra    Manthey
Diana     Rigsby
Gabriel   Rathbun
Robin     Francois
Phillip   Lyons
Henry     Allen
Angela    Boyd

Then, we need to edit the email addresses and names

$NewData = $data | select @{Name="GivenName"; Expression={$_.GivenName}},`
    @{Name="Surname"; Expression={$_.Surname}},`
    @{Name="UPN"; Expression={$_.EmailAddress -replace "@.*",""}}

The result will look like this

GivenName  Surname    UPN
---------  -------    ---
Sara       Gregory
Fe         Haugen
Betty      McAllister
Sandra     Manthey
Diana      Rigsby
Gabriel    Rathbun
Robin      Francois
Phillip    Lyons
Henry      Allen
Angela     Boyd

Now that the file is edited, let’s export it to a new CSV file

$NewData | Export-CSV NewFile.csv -NoTypeInformation


Now that we have a NewFile.csv with our test users lets create the mailboxes. Open your Exchange Management Shell, Navigate to the folder where you save the NewFile.csv and run the following cmdlet:

$password = Read-Host "Enter password" -AsSecureString
Import-CSV NewFile.csv | ForEach {New-Mailbox -Alias $_.GivenName -Name ( $_.GivenName + " " + $_.Surname ) -UserPrincipalName $_.UPN -FirstName $_.GivenName -LastName $_.Surname -Password $password}


If your test is successful then try adding more users. You can also try with more options, for example I included the “Country Abbreviation” to the CSV file and replace the abbreviations with the names of some Organizational Units I created on my Active Directory (Italy’s abbreviation is IT which give you an IT department without replacing the name). Then add the -OrganizationalUnit to the cmdlet:

$password = Read-Host "Enter password" -AsSecureString
Import-CSV NewFile.csv | ForEach {New-Mailbox -Alias $_.GivenName -Name ( $_.GivenName + " " + $_.Surname ) -UserPrincipalName $_.UPN -FirstName $_.GivenName -LastName $_.Surname -Password $password -OrganizationalUnit $_.OU}


Sending Emails

Now that we have our users, we need to send some emails. Fortunately “Paul Cunningham” the “Exchange Server Pro” created a script that will do just that: Generate Email Traffic in a Test Lab Environment just follow the instructions shown in his blog and you will be fine. I do recommend you to change the values to send more emails.

I had tested Paul’s script in Exchange Server 2010 and 2013, unfortunately in Exchange 2010 we will need to install a certificate for the script to work. To install a certificate for our test lab the best is to use a self-signed certificate from our own private Certification Authority (CA). First we will need to install Active Directory Certificate Services (AD CS), request a certificate in Exchange server, and create our certificate with the newly installed CA, here you can find the steps to install AD CS, create a certificate and deploy it.

To request a certificate for your Exchange Server open the Exchange Management Shell and run the following command:

New-ExchangeCertificate -FriendlyName "Exchange 2010 Certificate" -IncludeServerFQDN -DomainName,, -GenerateRequest -PrivateKeyExportable $true

After you installed the certificate and follow all the steps in Paul’s blog, you can start the Mail Generator script. Open your Exchange Management Shell, navigate to the directory where you saved the script with all the files, and run it.

Note: In Exchange 2010 I still get an error that seems to be a bug. However do not worry about it, the script will still generate emails and send them to random users.

You can keep sending emails for a while just to populate all the mailboxes with some data.

This will conclude part #5 of this Lab. See you in Part #6.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s