Creation & Verification of Multiple Online Domains

Posted on Updated on

For admins who have many custom domains they need to create and verify, they can either use the manual process or you can use PowerShell to get these domains up and running in no time at all:


  1. Open a new Microsoft PowerShell for Online Services command-shell and connect into your Office 365 tenant.  Download here if you don’t have a copy:
    1. Connect-MSOLService [use Global Admin credentials]
  2. Create a new domains.txt or domains.csv file (your preference) with one column and a list of all your custom domains.
    1. Column: DomainName
  3. Import-Csv .\domains.txt | foreach { New-MsolDomain -Name $_.DomainName }
  4. Once the above process is complete, export the list of DNS records for each unverified domain:
    1. (Get-MsolDomain
      -Status Unverified).Name | foreach { Get-MsolDomainVerificationDns -Mode dnstxtrecord -DomainName $_ } | Select-Object Label, Text | Export-Csv DNS.txt
  5. Create your DNS records for each domain based on the information placed into the DNS.txt file, which will be located in the same folder where you run the above command.
  6. Once all DNS records are in place, you can complete this process by confirming all these PowerShell created unverified domains:
    1. (Get-MsolDomain -Status Unverified).Name | foreach { Confirm-MsolDomain -DomainName $_ }

Note – You can only have 50 unverified domains in your online tenant.  If you have more than 50 domains, you should perform these steps in batches of 50.

Whatcha thinkin?

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s