The Confirm-MgDomain cmdlet is used in Microsoft Graph PowerShell to verify domain ownership in Microsoft Entra ID. It is typically used after adding a domain to Microsoft Entra ID using the New-MgDomain cmdlet and configuring the required DNS records. Once verification is successful, organizations can use the configured domain for user sign-ins, email addresses, and other services.
Before using the Confirm-MgDomain cmdlet, ensure the following:
Install-Module Microsoft.Graph -Scope CurrentUser
Here's how you can use the Confirm-MgDomain cmdlet to confirm ownership of an Microsoft Entra ID domain:
Confirm-MgDomain
-DomainId <String>
[-ResponseHeadersVariable <String>]
[-Headers <IDictionary>]
[-ProgressAction <ActionPreference>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Example 1: Confirming domains in Microsoft Entra ID
Confirm-MgDomain -DomainId "zky.com"
The following are some parameters that can be used along with the Confirm-MgDomain cmdlet:
| Parameters | Description |
|---|---|
| -DomainId | This parameter allows you to specify the domain name to be verified. |
| -WhatIf | This parameter allows you to simulate the command without executing it. |
| -Confirm | This parameter asks for confirmation before executing the cmdlet. |
While Microsoft Graph PowerShell allows domain ownership verification using Confirm-MgDomain, there are some limitations:
PowerShell’s complexity and reliance on scripting create a steep learning curve, making not just domain ownership verification but also Microsoft Entra ID management and reporting quite challenging. ADManager Plus eliminates these challenges with an intuitive UI, delegation, management, and reporting capabilities, enabling IT teams to efficiently handle Microsoft Entra ID objects without the need for complex scripts.