Odd issue I’ve been dealing with that is sending me crazy. here is our config:
* E3 Subscription
* Exchange 2010 Hybrid
* ADSync with AADConnect
* User mailboxes hosted on 365 Exchange
When creating a new user we are using the New-RemoteMailbox method. This creates the user mailbox on 365, creates the user on our local AD, then syncs the ADs.
User creation part works fine. Remote mailbox is reated fine. The problem is with the aliases/proxy and routing address. When the remote mailbox is created, it makes the routing address – firstname.lastname@example.org and correct alias – email@example.com. But when the user appears in 365, it only has firstname.lastname@example.org (eventually the onmicrosoft.com email alias shows)
As per MS description of what new-remotemailbox should do:
>”Use the New-RemoteMailbox cmdlet to create a mail user in the on-premises Active Directory and also create an associated mailbox in the cloud-based service.
>New-RemoteMailbox cmdlet **automatically calculates the SMTP address of the mailbox** to be used with the RemoteRoutingAddress parameter. ”
The part of my script that call new-remotemailbox is as follows
`New-RemoteMailbox -Name $fullname -FirstName $firstname -LastName $lastname -DisplayName $fullname -SamAccountName $logonname -UserPrincipalName $logonname@$domain -PrimarySmtpAddress $logonname@companyname -Password $password -OnPremisesOrganizationalUnit $OU`
The problem I have is that is either calculating the wrong address, or not generating the correct proxy/alias address on the users 365 existence.
[MS 365 Admin Center](https://i.redd.it/a0r2budgt2q11.png)
Has anyone else come across this? Or am I missing something really simple