Problem

If you want to add or remove (basically update) a proxy address on a cloud-only account - without an Exchange mailbox - you cannot.

There is no such option in the GUI and PowerShell won’t allow it either, throwing an error:

Set-MgUser : Property 'proxyAddresses' is read-only and cannot be set.
Status: 400 (BadRequest)
ErrorCode: Request_BadRequest

Solution

Use the Graph API BETA endpoint.

  • Method: PATCH
  • URL: https://graph.microsoft.com/beta/users/<User_ID>
  • Request Body:
1
2
3
4
5
6
7
8
{
    "proxyAddresses": [
        "SMTP:PrimarySMTPAddress",
        "smtp:Alias1",
        "smtp:Alias2",
        "smtp:Alias3"
    ]
}
  • Expected Response: 204 No Content
Graph Explorer

An example

Tip

You can first retrieve the existing proxy addresses and paste them into the Request Body, then add or remove the entries you need.

1
https://graph.microsoft.com/beta/users/<User_ID>?$select=proxyAddresses
Graph Explorer

An example