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.
Before using the New-MgDomain cmdlet, ensure the following:
Install-Module Microsoft.Graph -Scope CurrentUser
Run the following script to add a new domain:
New-MgDomain -Name "zky.com"
Example 1: Add a new domain to Microsoft Entra ID.
New-MgDomain -Name "zkyy.com"
| 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. |
While PowerShell provides powerful command-line capabilities for managing Microsoft Entra ID, it comes with several limitations that can make administration challenging:
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.