I was setting up a custom domain within Azure, and after I add the TXT record to our DNS to verify ownership. It gave me the following error message.
To do this in PowerShell we’re going to install the Azure ActiveDirectory (MSOnline) Module
Remove-MSolDomain -DomainName safetonet.com
I was greeted with the following error:
I then ran the Get-MsolUser command as the error suggested
Get-MsolUser -DomainName safetonet.com
But this returned nothing.
You need to remove the users, groups and XXXX before being able to remove the domain.
Within the Office 365 portal I wasn’t able to delete the group that existed for the domain.
But by running the Get-MsolGroup command I can see all the groups in the account
I can see the group that exists within the domain. And can take note of the objectid to use with the remove command Remove-MsolGroup
Remove-MsolGroup -Objectid '9b1aer67-11x4-4398-b8cb-330b923f3016'
Now we have deleted all the resources in the domain we can again use the Remove-MsolDomain command to delete our Domain.
Remove-MSolDomain -DomainName contoso.com
I'm a .NET Software Engineer. Obsessed with Scrum / agile practices, DevOps, Azure... and C# of course
Nant (1) Load testing (1) Visual studio (1) Azure (25) Aws (1) Asp.net (1) Tfs (1) Puppetlabs reports (2) Devops (2) Iis (1) Powershell (7) Arm templates (2) Arm template (1) Azure (9) Arm (2) Powershell (1) Dsc (1) Jekyll (1) Vsts (1) Arm (2)