Removing Custom Domains with Mail-Enabled Security Group Dependencies
Short answer
C Update or remove the mail-enabled security group references, and then use the –ForceDelete option for contoso.com.
Question
The fabrikam.com domain is the default domain.
The contoso.com domain uses managed authentication, and has 750 references across unused user accounts, application identifier URIs, and mail-enabled security groups.
You need to remove contoso.com from the subscription. The solution must minimize manual changes to Microsoft Entra objects.
What should you do?
Key Takeaways
The main trap is ignoring mail-enabled security groups, which prevent standard domain deletion and require explicit cleanup before using the ForceDelete flag.
Learn how to safely remove a Microsoft 365 custom domain containing mail-enabled security groups by updating references and using ForceDelete to minimize manual effort.
Common mistake: Attempting to use -ForceDelete immediately (Option B) without cleaning up mail-enabled security groups, which causes the deletion to fail due to unresolved dependencies.
Expert Analysis
The scenario involves removing a custom domain (contoso.com) that has significant dependencies, specifically 750 references across user accounts, application identifier URIs, and mail-enabled security groups. The critical constraint is to minimize manual changes.
Option A suggests manually renaming all references. With 750 objects, this is impractical and violates the 'minimize manual changes' requirement. It also ignores the technical necessity of handling mail-enabled security groups, which often have immutable attributes or require specific cleanup steps.
Option D is incorrect because you cannot delete the default domain in Microsoft 365. Furthermore, making it the default would not remove the dependencies; it would just change the primary context, leaving the same 750 references intact.
Option B proposes using the –ForceDelete option without changing mail-enabled security group references. In Microsoft 365, mail-enabled security groups are tightly coupled with Exchange Online. Deleting a domain that still has active mail-enabled security groups associated with it typically fails unless those groups are either removed or their email addresses/aliases are updated to point to another valid domain. Simply forcing deletion without addressing these specific object types usually results in an error or leaves orphaned data, which is not a clean solution.
Option C is the correct approach. You must first update or remove the references for the mail-enabled security groups (e.g., by removing their SMTP addresses or deleting the groups if they are no longer needed). Once these specific dependencies are resolved, you can use the –ForceDelete parameter on the Remove-MgDomain cmdlet (or equivalent admin center action) to remove contoso.com. This handles the stubborn mail-enabled objects explicitly while allowing the system to handle other references or confirming that they are cleared, thus minimizing manual heavy lifting compared to Option A, while ensuring technical validity unlike Option B.
Exam Strategy
When asked about domain removal, always check for 'mail-enabled' objects like security groups or distribution lists. These are harder to clear than standard user UPNs. If the question emphasizes minimizing manual work, avoid options suggesting bulk manual renames. Instead, look for solutions that address the specific technical blocker (mail-enabled groups) programmatically or via targeted updates before invoking force-delete flags.
Frequently Asked Questions
Why can't I just use -ForceDelete on a domain with mail-enabled security groups?
What does 'minimize manual changes' imply in this context?
Community Votes
100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 2 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 2
-
saidkha 👍 1Renaming 750 objects by hand is the opposite of minimizing manual changes so it cannot be A ! C is the correct answer.
-
Skri113xX 👍 1 Answered AA maybe
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.