I have been now searching for a script that would switch primary email between two domains, using Office 365 Exchange online
example
each user has a primary and alias email attached to his account, user@domainA.com - is primary user@domainB.com - is alias
i wish to switch and make @domainB.com the primary and the A as alias
been trying to find and it seems simple, but yeah i would need help
i will add a few more points that were done before.
The tenant has 3 domains: A, B, C, i only focused on users with A mad B
I followed this guide - https://gallery.technet.microsoft.com/office/Bulk-Add-SMTP-Addresses-to-e3d28842
and added the B domain to A domain users, (this did not create a SIP btw, is there another script for this as well?)
Before and after the guide
in the guide above i managed to create a filter, like this #Get the list of mailboxes in the Office 365 tenant
$Mailboxes = @(Get-Mailbox -Filter { WindowsEmailAddress -like “*@companyA.com” })
so when the script executed it did it all just for these users, companyC.com was not affected.
now what needs to be done is switching the main / primary domain for the users as explained in the first part.
Let me know if i can add more details, i found a lot of scripts but the mostly add new things or do some other changes, all i need to make the switch between alias and primary,
Since i am new to powershell, this would be a script file that is calling the text file right? also i just came across this link and i think it might fit the requirement