Recently in one of our trial environments, some of the users were not showing up in the Enabled Users view in Dynamics 365, although the users were having appropriate licenses assigned to them. (was more than 24 hours)
In such a scenario we can use Force Sync user action of Power Platform Management Connector.
For Force Sync users, we will be passing the object id of the user and selecting the appropriate environment.
Run the flow manually.
It asks for the Object Id of user.
Inside Azure Portal >> Azure Active Directory >> Users, get the Object Id of the user
Currently, we have below 3 users in CRM
Let us run the flow.
Wait for the flow to complete.
After successful execution of the flow, back in CRM, we can see user 5 added to the list of enabled users.
In case we are using a security group for the environment we can make use of the below Power Automate Template, it takes the security group’s object id as input and loops through each of the members and applies Force Sync user action.
We can also make use of PowerShell cmdlets to achieve the same
Hope it helps..