Replacing Primary SMTP Address

1.7k views Asked by At

I have the following, working no problem.


Enable-RemoteMailbox -Identity $username -RemoteRoutingAddress($username+'@MYORG365.mail.onmicrosoft.com') 

sleep 30

Get-RemoteMailbox $username|Set-RemoteMailbox -EmailAddressPolicyEnabled:$true

sleep 5

Get-RemoteMailbox $username|Set-RemoteMailbox -EmailAddressPolicyEnabled:$false

sleep 5

Get-RemoteMailbox $username|Set-RemoteMailbox -PrimarySmtpAddress($username+'@MYORG.com')

What this script does, it adds an additional "[email protected]" smtp to the mailbox that was just created for $username and set is as the primary smtp.

What i am trying to do next is either, EDIT the existing primary smtp , and set it like above. Or DELETE, the current primary smtp and add a NEW primary smtp instead of above, so that eventually i will end up only with a single SMTP / PRIMARY-SMTP for this new mailbox.

Your help is mostly appreciated.

Thanks !

0

There are 0 answers