Remove-MgDomain fails I'm trying to remove a domain using Remove-MgDomain according to the docs https://docs.microsoft.com/en-us/powershell/module/microsoft.graph.identity.directorymanagement/remove-mgdomain?view=graph-powershell-1.0&preserve-view=true
I can get my domain using Get-MgDomain -DomainID "mydomain.com", but removing the domain fails with a rather nonsensical error message.
Remove-MgDomain -DomainId "mydomain.com"
Remove-MgDomain_Delete1: Domain deletion attempt failed.
Is that specific cmdlet bugged, or am i missing something ?
CodePudding user response:
Turns out there was an AD user still referencing the domain. Deleted that user, and the removeMgDomain command worked.
Trying to delete the domain directly in the azure portal gave a much more informative errormessage, which made the problem clear.
