Could you please provide more information to help me understand your requirements better? Thx~
You want to change the user's account name, am I right?
Or do you want to change other names for users?
If you want to change the UPN for user's account, you can do it in the Microsoft 365 admin center by changing the user's username or by setting a different email alias as primary.
The sync app will automatically switch to sync with the new OneDrive location after a UPN change.
While the UPN change is propagating through your environment, users may see an error in the OneDrive sync app that "One or more libraries could not be synced." If they click for more information, they will see "You don't have permission to sync this library."
Users who see this error should restart the sync app. The error will go away when the UPN change has been fully propagated and the sync app is updated to use the user's new OneDrive URL.
More information, please refer to "How UPN changes affect the OneDrive URL and OneDrive features".
Any misunderstandings, you could let me know.
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.