How to confirm ownership of Microsoft Entra ID domains using the Confirm-MgDomain cmdlet

What is the Confirm-MgDomain cmdlet?

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.

Confirming ownership using the Confirm-MgDomain cmdlet

Prerequisites

Before using the Confirm-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
  • The required DNS records are correctly configured for domain verification.
  • Ensure that you have sufficient privileges, such as Global Administrator or Domain name administrators role, to manage domains in Entra ID.

Using the Confirm-MgDomain cmdlet

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>]

Examples

Example 1: Confirming domains in Microsoft Entra ID

Confirm-MgDomain -DomainId "zky.com"

Supported parameters

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.

Limitations of using Graph PowerShell scripts to validate domain ownership

While Microsoft Graph PowerShell allows domain ownership verification using Confirm-MgDomain, there are some limitations:

  • Users must have scripting knowledge and be familiar with PowerShell commands.
  • Graph PowerShell lacks a graphical UI, requiring manual script execution.
  • DNS propagation delays can cause verification failures, requiring troubleshooting.
  • Bulk domain verification for multiple domains is not natively supported.

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.

Microsoft Entra ID management and reporting using ADManager Plus

  • Manage and report on Microsoft Entra ID domains with a user-friendly interface.
  • Perform user provisioning, deprovisioning, and modifications in bulk without using any scripts.
  • Schedule and automate Microsoft Entra ID management tasks ,such as license management, group membership management, and user provisioning.
  • Generate comprehensive reports on Microsoft Entra ID users, groups, licenses, and more.

Enhance Microsoft Entra ID management and reporting with ADManager Plus

 
  • What is the Confirm-MgDomain cmdlet?
  • Confirming domain ownership in Microsoft Entra ID using the Confirm-MgDomain cmdlet
  • Limitations of using Graph PowerShell scripts to confirm domain ownership
  • Microsoft Entra ID management and reporting using ADManager Plus
The one-stop solution to Active Directory Management and Reporting
Email Download Link