Office 365 Proxy Address


I am trying to remove an old email address from a user in AD thats sync via AAD Connect as I would like to use the email address for a DL.

In AD I have removed the SMTP address from proxyAddresses and forced a sync but the email address is still listed in the Office portal, how can I remove the address?

email to remove from user -
Current primary email -

Ben SAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jose Gabriel Ortega CastroCEOCommented:
Hi ben, you would need just to remove it completely, force update and then create use it in your DL.

$credential = New-Object -TypeName System.Management.Automation.PSCredential -argumentList  "", ("thePassword" | ConvertTo-securestring -AsPlainText -Force)
Connect-MsolService -Credential $Credential

#Remove users online users without license
Get-MsolUser | where{ $_.isLicensed -eq  $false} | foreach{ Remove-MsolUser -UserPrincipalName $_.UserPrincipalName}

Open in new window

Ben SAuthor Commented:
Hi Jose,

Would lose the mail in the mailbox running the above PowerShell?

I have tried other script but keep getting this error:

The operation on mailbox "User" failed because it's out of the
current user's write scope. The action 'Set-Mailbox', 'EmailAddresses', can't
be performed on the object 'User' because the object is being
synchronized from your on-premises organization. This action should be
performed on the object in your on-premises organization.
Jose Gabriel Ortega CastroCEOCommented:
In the 1st line, would be your domain admin user

in the second line would be the one you want to remove, this would be

#This would be the remove of the deteledusers
Get-MsolUser -ReturnDeletedUsers | foreach{ Remove-MsolUser -RemoveFromRecycleBin -ObjectId $_.Objectid -Force }

Open in new window

Vasil Michev (MVP)Commented:
Did you force a Full sync after you made the change on-premises? You need to use the Start-ADSyncSyncCycle cmdlet as detailed here:

Start-ADSyncSyncCycle -PolicyType Initial

Open in new window

It's also important to remember that O365 will force each mailbox to have at least one alias matching the UPN, so you might have to change that too.

I definitely would advise against removing the user, as it will result in him losing access to all data in O365.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Aaron GuilmetteTechnology Solutions ProfessionalCommented:
1.  If you're syncing, it has to be removed from on-premises.
2. You're trying to remove the SMTP address that matches the UPN of the user, which will cause you problems.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.