If you have configured Hybrid integration between Exchange 2010/2013 with Office 365 using dirSnyc or Azure active directory sync tool and then stopped the synchronization. The accepted domains and additional domains will be removed from the user’s Attributes on the cloud and in order to add these accepted domains again to all of the Office 365 users..
First we’ll have to connect to Exchange online with the following powershell tool. so Launch Azure powershell as Admin and copy the following line by line.
1- $UserCredential = Get-Credential
2- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
3- Import-PSSession $Session
First we’ll show/view user’s existing SMTP addresses, in order to do so we’ll use the following PowerShell cmdlet
For all users
4- Get-Mailbox | fl –property Alias, WindowsLiveID, EmailAddresses
Get-Mailbox –Identity user@domain.com | fl –property Alias, WindowsLiveID, EmailAddresses
For one user
Procedure to add an additional accepted domain to all users in the Office 365 tenant.
Note:
The domain must be verified on Office 365 first before applying those steps
1-
$users = Get-Mailbox
2-
foreach ($a in $users) {$a.emailaddresses.add(“smtp:$($a.alias)@AdditionalDomain.com”)}
3-
$users | {308b10a016e19a1cd6a208cbc3961927e16fc6766a4020d3c4ef54ea17925f0f}{Set-Mailbox $_.Identity -WindowsEmailAddress $_.WindowsEmailAddress}
Hope you find this useful.