Unable to Set ProxyAddresses from Powershell to Azure AD Users

Parth Mansata 25 Reputation points
2024-08-02T14:59:01.88+00:00

I have 2 domains registered in my Microsoft Admin Center. Let's say they are abc.com, and def.com.

All the Users in my organization have primary email as firstname.lastname@abc.com and Alias added as firstname.lastname@def.com.

Now I have added 3rd domain as xyz.com, and want all users to have one more email alias as firstname.lastname@xyz.com. This process is to be done as Bulk Operation, and the best way I identified is doing it from the Powershell. I found 2 methods to bulk update users from the Powershell, and they are:

  1. Using Graph APIs - https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0#properties
    1. Here it is clearly mentioned that the Property proxyAddresses is read-only and cannot be updated via Graph APIs
  2. Using SetAzureADUser Script - https://learn.microsoft.com/en-us/powershell/module/azuread/set-azureaduser?view=azureadps-2.0
    1. Here if we get the user first with the Get-AzureADUser -Filter $filter | select DisplayName,ProxyAddresses command, it responses with all the EmailAlliases/ProxyAddresses, but same if we try to update using the command
    • Set-AzureADUser -ObjectId user@abc.com -add @{ProxyAddresses='smtp:user@xyz.com'} or
    • Set-AzureADUser -ObjectId user@abc.com -ProxyAddresses 'smtp:user@xyz.com' it reutrns with the error as Set-AzureADUser : A parameter cannot be found that matches parameter name 'ProxyAddresses'

So, is there any ways where I can add one more Proxy Address to the Azure AD User.

Microsoft Exchange Online
Active Directory
Active Directory
A set of directory-based technologies included in Windows Server.
6,552 questions
Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,535 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
21,812 questions
{count} votes

Accepted answer
  1. Erick Moreno 330 Reputation points
    2024-08-06T07:06:06.0566667+00:00

    You can use Exchange Online module, here

    Set-Mailbox "Identity" -EmailAddresses @{add="user@xyz.com"}
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.