Exchange 2016 / 2019 Adding a New Email Domain

KB ID 0001297

Problem

On EE this morning someone asked this question and I realised I’ve never written it up. So If you want to add a new domain to an already working Exchange deployment how do you do it?

Solution

Firstly, you need to have purchased the new domain name, and have the DNS records setup properly  for the new domain name. See the following article;

Setting up the Correct DNS Records for your Web or Mail Server

Add the New Domain Into Exchange 2016 / 2013

Log into Exchange Admin Center > Mail Flow > Accepted Domains > Add.

Add a sensible name > Enter the new domain name > Select Authoritative > Save.

Create a User Mailbox For the New Domain

If you only have a few users to setup you can do them manually within the Exchange Admin Center  > Recipients > Mailboxes > Add.

On the properties of the new recipient you can edit the email addresses associated with it.

Change and add accordingly.

Remember for individual users to untick the ‘Automatically update email addresses based on the email address policy applied to this recipient’ > then change the Clients ‘Reply address’ > OK > Save.

Create an Email Address Policy And Apply It to an OU

The procedure above does not scale well if you have a lot of users to allocate a new domain to, so you can write a new email address policy, and apply it to a particular OU, then create/import your new users into this OU, mail enable them, and they will all get the correct Email addresses.

Mail flow > Email Address polices > Add.

Add a new policy with the email  format you require;

Repeat to add multiple email address formats > Save.

Scroll down to where you want to apply the  policy to and select ‘recipient container’, (because OU would have been to simple).

Select the OU with your users in > OK.

Note: You don’t have to use OU’s you can use other things like ‘department’ which will get read from the users AD object.

OK

With the policy selected  > Apply.

Now go and have a few cups of coffee, and your users will get the new policy.

Related Articles, References, Credits, or External Links

NA

Bulk Export Users From One Domain, and Import Into Another

KB ID 0000794 

Problem

I’ve written in the past about bulk importing users with CSVDE, but what if you want to move/migrate your users to another domain? You first need to export all the users, then import them into the new domain.

Solution

Step 1 Export Domain Users to CSV File

1. Here all my users are in one OU, if that OU has ‘nested OU’s within it that’s OK.

2. The command to ‘export’ is as follows;

Note: You need to ‘run as administrator

[box]

csvde -d {LDAP Path} -f c:\filename.csv

Example

csvde -d "ou=Main-Site,dc=pnl,dc=com" -f C:\ExportedUsers.csv

[/box]

3. The users will be exported. If it fails at this point it will give you a descriptive error, CSVDE has been around for a while, Google the error (most fixes are pretty simple).

4. Now open the CSV File with Excel, the second line will probably be the OU, you can leave this here if you want but if your target OU is different (or Like me you prefer to create it manually), then delete row 2 (Don’t delete Row 1!).

5. You do not need all the columns, delete all the columns EXCEPT,

DN
objectClass
ou
distinguishedName
name
cn
sn
givenName
displayName
sAMAccountName
userPrincipalName

So when complete it should look like the following;

6. Change any details in the LDAP path that are different for the new domain.

7. You may also need to change the domain name that’s listed on the userPrincipleName.

Step 2 Import Domain Users from CSV File

1. On the target domain, (if you are not importing the OU’s, then make sure they already exist). The syntax for the import is;

[box]

csvde -i -f c:\filename.csv

 

[/box]

9. Your users should be imported.

10. By default they will be disabled, but you can bulk enable them.

11. At this point all the users have no password, this can also be bulk set.

Windows – Reset all User Passwords in an OU

 

Related Articles, References, Credits, or External Links

NA