Can we trigger a CRM online Plugin when a systemuser is enabled/disabled
Views (1092)
This is another repetitive question being asked in community. The binary answer in NO.
First we have to understand - the user Flow is handled by Microsoft in background & definitely the user update SDK call message is not getting trapped by messages like Update, SetState, SetStateDynamicEntity. So plugin cannot be triggered.
That being said user record may be disabled when license is revoked, AD account got locked due to inactivity or password expiry. So MS replicating those AD changes to CRM through a backdoor.
We all know that the CRM online system user provisioning is little complex. My Stack Overflow answer gives you a picture:
First we have to understand - the user Flow is handled by Microsoft in background & definitely the user update SDK call message is not getting trapped by messages like Update, SetState, SetStateDynamicEntity. So plugin cannot be triggered.
That being said user record may be disabled when license is revoked, AD account got locked due to inactivity or password expiry. So MS replicating those AD changes to CRM through a backdoor.
We all know that the CRM online system user provisioning is little complex. My Stack Overflow answer gives you a picture:
In Dynamics 365 CRM online, system users record creation/enabling flow happens from O365 Admin portal end. Read more
Steps go like this:
1. Security group has to be created in Active directory & mapped in O365 Admin portal for any CRM Org
2. Users has to be added in that AD Security group
3. All the users from SG will be replicated as system users in CRM instance
4. In O365 Admin portal, on assigning CRM license (Basic/Pro) against the user - the system user record will be enabled in CRM
5. In CRM side, we will assign Security role to complete user on-boarding
1. Security group has to be created in Active directory & mapped in O365 Admin portal for any CRM Org
2. Users has to be added in that AD Security group
3. All the users from SG will be replicated as system users in CRM instance
4. In O365 Admin portal, on assigning CRM license (Basic/Pro) against the user - the system user record will be enabled in CRM
5. In CRM side, we will assign Security role to complete user on-boarding
We cannot create system user using SDK directly because of above manual steps outside CRM online. Can be created using PowerShell like answered in community.
Solution:
Same way, user enabling/disabling also handled in a different way and it’s not triggering platform plugin. So we have to do some Task scheduler kinda console job or SSIS + Kingswaysoft package job on timely fashion to fetch the systemuser entries to check status and take action.
I have not tried Logic apps or MS Flow, will blog my experience if I do so.
This was originally posted here.

Like
Report
*This post is locked for comments