Recently, we encountered an issue with user synchronization in Management Reporter (MR) 2012 for Microsoft Dynamics ERP. Issue is that newly created users are not synchronized from Microsoft Dynamics AX 2012 to MR, if any user is deleted from active directory which is previously added in MR through AX-MR user synchronization and these users are still present in Dynamics AX.
To resolve this issue, you have to manually deleted each user from MR database which deleted from active directory. In most of the scenarios, following steps are worked:
Take the backup of MR database Safe side. Very important if something goes wrong.
1. First find the user in SecurityPrinciple table.
2. Try to delete that record from the SecurityPrinciple table and if system gives error related to child records exist for this record then first delete records from that table.
3. In our case, system give error on SecurityCompanyPermissionIntegration table. First check its relationship with SecurityPrinciple table and then delete records using that relationship column.
4. If you find same error with other tables like ControlRowMaster, ControlTreeMaster, ControlColumnMaster, ControlReport, ControlReportScheduleTask etc then do not delete the records just update those records with Admin ID because this table contains records related to report designs and most of these tables have relationship of LastModifiedBy column with SecurityPrinciple ‘s ID column. So this is the safest option to not deleted the records which needed in report execution.
Whenever you want to delete a user from active directory then first disable that user from Microsoft Dynamics AX and synchronize Management reporter.