Hi @Liam Ray
Thank you for reaching out to Microsoft Learn Q&A!
From my research, I agree with you that the extension attribute property cannot be changed when it was previously synced from an on-premises Active Directory as read-only, since the source of authority for these properties is the on-premises environment.
Reference: onPremisesExtensionAttributes resource type - Microsoft Graph v1.0 | Microsoft Learn
From the information above, one possible approach is to update the Customer Attribute mapped to ExtensionAttribute1 using Exchange Online or Exchange Online V2 PowerShell modules.
For example, you could combine this with your idea of using an API call and PowerShell command such as:
Set-Mailbox -Identity ******@domain.com -CustomAttribute1 "NewValue"
This could be automated through a cloud flow like:
Trigger event => API => Execute PowerShell => Attribute update
Note: Remember to run
Connect-ExchangeOnline -AppId <AppId> -CertificateThumbprint <Thumbprint> -Organization <TenantName>
for unattended scripts using the Exchange Online module and ensure the module is imported and installed on the API host.
Another method, similar to your idea, is to update the extension attribute in the on-premises environment first and then sync it to the customer attribute. The automated flow would look like this:
Trigger event => API => Execute PowerShell
Set-ADUser -Identity $UserPrincipalName -Replace @{extensionAttribute1="NewValue"}
=> Sync to Azure AD => Custom attribute update
Note: Make sure the Active Directory module is installed on the API host.
Additionally, you could consider using an extension-based Hybrid Runbook Worker as an alternative to the API host. Reference: Deploy an extension-based Windows or Linux User Hybrid Runbook Worker in Azure Automation | Microso…
I hope these suggestions provide some helpful ideas. As a forum moderator, I don’t have access to a dedicated testing environment, so I cannot confirm whether these options will work fully in your setup. For more advanced assistance, I highly recommend reaching out to the Microsoft Technology Community, where experts with hands-on experience can provide deeper insights.
I apologize for any inconvenience caused by transitioning to another forum, and I truly appreciate your understanding.
Thank you for your time and patience.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.