You cannot, the whole idea of using directory synchronization is that changes to object and their attributes are managed centrally in your on-premises AD. Graph API, PowerShell or the admin center UI will not help you here, use the AD tools. Or if you want to manage objects via Graph, create them directly in Azure AD.
Modify Sync User Attributes with Microsoft API Graph

Nina Franchaisse
41
Reputation points
Hello,
I have an Active Directory synchronized on an Azure AD (with Azure AD Connect) and I want to create a script that changes user attributes.
I use API Graph calls and it works for full cloud accounts but not for synchronized ones and returns the error :
“Unable to update the specified properties for on-premises mastered Directory Sync objects or objects currently undergoing migration.”
Do you know if it is possible to modify sync user attributes with API Graph ?
Thanks you