PowerShell check Office 365 Msol (Azure AD) and Exchange Online default domain

Hi Guys,

As you know I juste had an issue with a client Office 365 tenant (Office 365 unsynced default between Msol and Excahnge Online).

Here is wrapup function of the Cmdlets I wrote to check this situation:

[ps]Function Get-MsolAndExODefaultDomain {
$MsolDefaultDomain = (Get-MsolDomain | Where-Object { $_.IsDefault -eq $true }).Name
$ExODefaultDomain = (Get-AcceptedDomain | Where-Object { $_.Default -eq $true }).Name
New-Object -TypeName PSObject -Property @{
MsolDomain = $MsolDefaultDomain
ExODomain = $ExODefaultDomain
}
}[/ps]