Creating a new domain in Microsoft Entra ID using Microsoft Graph PowerShell

What is the New-MgDomain cmdlet?

The New-MgDomain cmdlet in Microsoft Graph PowerShell enables IT administrators to add new domains to Microsoft Entra ID (formerly Azure AD). This cmdlet helps integrate domains with Microsoft services, verify ownership, and configure authentication settings for seamless user access.

Adding a new domain to Microsoft Entra ID tenant using Graph PowerShell

Prerequisites

Before using the New-MgDomain cmdlet, ensure the following:

  • The Microsoft Graph PowerShell module is installed. If not, install it using this script:
    Install-Module Microsoft.Graph -Scope CurrentUser
  • Connect to Microsoft Graph PowerShell with administrative privileges to add new domains.

Using the New-MgDomain cmdlet

Run the following script to add a new domain:

New-MgDomain -Name "zky.com"

Examples

Example 1: Add a new domain to Microsoft Entra ID.

New-MgDomain -Name "zkyy.com"

Supported parameters

Parameters Type Description
-Name String This parameter is used to specify the name of the new domain to be added.
-IsDefault Boolean This parameter sets the newly added domain as the default domain.
-AuthenticationType String This parameter is used to define the authentication methods for the domain.
-IsRoot Boolean If this parameter is set to true, the domain is treated as a root domain.
-IsVerified Boolean Indicates whether the domain is verified.

Limitations of using Graph PowerShell scripts to manage Microsoft Entra ID

While PowerShell provides powerful command-line capabilities for managing Microsoft Entra ID, it comes with several limitations that can make administration challenging:

  • Requires administrators to have in-depth knowledge of PowerShell scripting.
  • Lacks a graphical user interface (GUI), making it difficult to track and visualize configurations.
  • Does not provide an easy way to delegate specific management tasks to different administrators.
  • Error messages can be complex and lack clear troubleshooting guidance.

ManageEngine ADManager Plus eliminates these challenges by providing a centralized, intuitive console to efficiently manage users, groups, contacts, mailboxes, etc. across Active Directory, Microsoft 365, and Google Workspace.

Highlights of using ADManager Plus for Microsoft 365 management

  • Create, modify, and manage Microsoft 365 users in bulk without relying on complex PowerShell scripts.
  • Effortlessly manage Microsoft 365 groups, assign or revoke licenses in bulk, and optimize resource allocation.
  • Generate detailed reports on users, groups, licenses, and more, and instantly manage them.
  • Securely delegate Microsoft 365 management tasks to help desk technicians with help desk roles.

Streamline Microsoft 365 management with ADManager Plus

 
  • What is the New-MgDomain cmdlet?
  • Adding a new domain to Microsoft Entra ID tenant using Graph PowerShell
  • Limitations of using Graph PowerShell scripts to manage Microsoft Entra ID
  • Highlights of using ADManager Plus for Microsoft 365 management
The one-stop solution to Active Directory Management and Reporting
Email Download Link