• Status: Solved
  • Priority: Medium
  • Security: Private
  • Views: 47
  • Last Modified:

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?

UPN - reception@companya.com
email to remove from user - reception@companya.com
Current primary email - jo@companyb.com

Ben S
Ben S
1 Solution
Jose Gabriel Ortega CEE Solution Guide - CEO Faru Bonon ITCommented:
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  "user@domain.onmicrosoft.com", ("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  jo@companyb.com 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 CEE Solution Guide - CEO Faru Bonon ITCommented:
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: https://docs.microsoft.com/en-us/azure/active-directory/connect/active-directory-aadconnectsync-feature-scheduler#start-the-scheduler

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.
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now