Office 365 script to swap SMTP addresses

Good afternoon.

We’re about to swap domains in Office 365, and was wondering if there’s a script to change our primary and secondary SMTP addresses?

Thank you for any help.

There are always scripts available.

this article pretty much walks you through the standard options.
just know that primary address is represented by “SMTP” upper case, and all secondary address re represented by “smtp” lower case