Under the Azure Active Directory
| Custom domain
section, click Add custom domain
and complete the verification process to prove that you are the owner of the domain:
![](https://static.packt-cdn.com/products/9781789132304/graphics/0306bf3d-ad76-44dd-840e-60efd9326516.png)
Actual configured domains
Add the TXT
entry shown to your DNS zone to verify the domain:
![](https://static.packt-cdn.com/products/9781789132304/graphics/2b0dabe3-b663-4768-ab8a-4ba8ae2bd1a3.png)
Domain verification options
Click the Verify
button on your Azure portal, and after successful verification, the new DOMAIN NAME
will appear under DOMAINS
. Choose the Make primary
option:
![](https://static.packt-cdn.com/products/9781789132304/graphics/e7c59295-2332-40fa-a83e-8feab65fa777.png)
Custom domain overview and configuration options (Make primary or Download the Azure AD Connect tool)
Open https://portal.office.com to complete the domain setup process under the admin section:
![](https://static.packt-cdn.com/products/9781789132304/graphics/beb20333-8355-494e-a1e1-896dfb76e29f.png)
Office 365 setup wizard
Choose the custom domain to be used for email addresses:
![](https://static.packt-cdn.com/products/9781789132304/graphics/af8226c0-9aa1-4763-8e27-6f22c339e5b4.png)
Sign-in and mail options
The last step we need to take is to set the new UserPrincipalNames
to the existing users. We do this with a small example scripting solution:
- Connect to your Azure AD with your global administrator credentials:
Connect-AzureAD
- Export the existing users to a CSV file with the following cmdlet:
Get-AzureADUser -All $True | Where { $_.UserPrincipalName.ToLower().EndsWith("onmicrosoft.com")} | Export-Csv C:\Office365Users.csv
- Remove all accounts you don't want to modify and make the change with the following cmdlets:
$domain = "inovitlabs.ch" Import-Csv 'C:\Office365Users.csv' | ForEach-Object { $newupn = $_.UserPrincipalName.Split("@")[0] + "@" + $domain Write-Host "Changing UPN value from: "$_.UserPrincipalName" to: " $newupn -ForegroundColor Green Set-AzureADUser -ObjectId $_.UserPrincipalName -UserPrincipalName $newupn }
- You should get a result similar to this:
![](https://static.packt-cdn.com/products/9781789132304/graphics/9bb91022-ef92-4d30-989b-ffd3d2bc8228.png)
Active users overview
The primary email will also be changed to the custom domain.
Next, we will configure the Azure AD Domain services to provide a transition scenario for a Kerberos-based application that is normally provided in on-premises infrastructure.