Search code examples
azureazure-ad-b2cazure-ad-graph-api

How to remove proxyaddresses from B2C user?


I'm trying to update a user's email, but I can't because the proxy addresses are already in use. The problem is that the email is a proxy address of another, not the main one, and we cannot use it for another user. Is there a way to remove the proxy addresses without removing the user?

enter image description here


Solution

  • As mentioned in this MS Doc,

    For Azure AD B2C accounts, proxyAddresses property has a limit of 10 unique addresses. Read-only in Microsoft Graph; You can update this property only through the Microsoft 365 admin center. Cannot be updated to null.

    When I tried to remove proxy addresses by running below PATCH request for Azure AD B2C user in Microsoft Graph Explorer, I too got same error:

    PATCH https://graph.microsoft.com/v1.0/users/userID/
    {
        "proxyAddresses": []
    }
    

    Response:

    enter image description here

    If users are licensed, you can only update or remove proxyAddresses via below Admin portals:

    Microsoft 365 admin center:

    enter image description here

    Exchange Admin Center:

    enter image description here

    If users are non-EXO licensed, you can make use of /beta Graph API endpoint to update proxy addresses:

    PATCH https://graph.microsoft.com/beta/users/userID/
    {
        "proxyAddresses": []
    }
    

    Response:

    enter image description here

    References:

    Remove old proxyaddress entry for user in azure active directory b2c - Stack Overflow by floyd

    Remove ProxyAddresses from Azure B2C account via powershell (reddit.com) by icebreaker374