Remove old proxyaddress entry for user in azure active directory

22,379

Solution 1

ProxyAddresses attribute for a unlicensed cloud-only user is read only unfortunately. There is a hacky workaround that will remove unwanted proxyAddresses for a cloud only unlicensed user though. Those steps are:

  1. Soft-delete the user with the bad proxyAddress. Example: [email protected]

  2. Create a dummy user [email protected] and update this dummy user's mail attribute with the SAME email that you want to remove from the user soft-deleted in step 1.

  3. Using the MSOnline powershell module run the following cmds:

    Connect-MsolService
    Restore-MsolUser -UserPrincipalName [email protected] -AutoReconcileProxyConflicts
    
  4. Confirm from Azure AD portal that the proxyAddress [email protected] has now been removed from [email protected] account. From Azure AD portal, you may now delete [email protected].

NOTE: This process is ONLY needed for a unlicensed cloud-only user. If user is a M365 liensed user you can use the M365 admin portal to remove the alias mentioned in another answer. If the user is a synchronized user from on-prem AD, then on-prem AD is the source of authority and you can update proxyAddress there and sync to AAD.

Solution 2

Not sure if AAD Powershell can make it. But there is a quick way to do this.

You can log into O365 admin center with an admin account.

Find the User B and click on it. After the user details open, click on Manage username and email.

enter image description here

Then you can click on "···" -> Delete alias to remove the smtp proxaddress.

enter image description here

Share:
22,379
Daniel Widdis
Author by

Daniel Widdis

I'm a software development engineer working on OpenSearch. In my spare time I'm the author and primary maintainer of the Operating System and Hardware Information (OSHI) library for Java. I am also a committer on the Java Native Access (JNA) project, and contributor to multiple other open source software projects. In case you missed it, I am a passionate supporter of Open Source software. My profile picture is intended to bring awareness to neurodiversity. Neurodiverse individuals can be highly valuable employees. Hiring neurodiverse talent brings your company loyal, fantastic workers with focused and useful skill sets. I respect people as individuals and call them what they ask to be called. Pronouns: he/him.

Updated on May 02, 2022

Comments

  • Daniel Widdis
    Daniel Widdis about 2 years

    We have an application which uses Azure B2C and Azure Active Directory.

    Problem: User A wants to set his specific email address. But this is not possible because User B already used this email address before. User B has a proxyaddresses entry for this email, although User B does not use the emailadress anymore.

    We tried to remove the smtp entry in proxaddresses for User B:

    1. Azure Portal --> Values for ProxyAddresses are not editable
    2. Windows Powershell
    Connect-AzureAD -TenantId <TenantID>
    $User = Get-AzureADUser -ObjectId "<ObjectIDUserB>"
    $User.ProxyAddresses //Displays all proxyaddresses(smtpEntries)
    $User.ProxyAddresses.Remove("<smtpEntry>")
    Set-AzureADUser -ObjectId "<ObjectIDUserB>" //But then there is no parameter for ProxyAddresses to update
    

    Are we missing something here or is there another way to remove a proxyadress entry for a user in azure ad?

  • Allen Wu
    Allen Wu over 3 years
    If my answer is helpful for you, you can accept it as answer( click on the check mark beside the answer to toggle it from greyed out to filled in.). See meta.stackexchange.com/questions/5234/…. This can be beneficial to other community members. Thank you.
  • Admin
    Admin over 3 years
    We don't use Office 365 in our AAD. We just use the active directory to signin to our application (Azure B2C). Unfortunately your suggested solution is not working for us. But we appreciate your help.
  • Hilarion
    Hilarion over 3 years
    I have the same problem and similar/same conditions - I'm using an Azure AD without any O365 subscription/license. A user was mistakenly updated with an e-mail address not belonging to them and although the profile e-mail addresses were corrected, the ProxyAddress entry for that e-mail address has remained and it prevents using that e-mail address for the correct user. What may also be important is that the user is a B2B guest account, not a direct member of the AAD.
  • Rob Traynere
    Rob Traynere almost 2 years
    I know it's uncouth to do, but I genuinely wanted to thank you for this answer since I don't have any other way to let you know it was a huge, huge help.