I fully understand that removing users (SystemUser Entity) in CRM Dynamics 2011 is not supported by Microsoft.
However, we are currently developing a tool to support our user needs. In order to be able to record integration tests for this tool, it seems necessary to be able to subsequently remove users so that we can roll back our test environment to its original state.
We are currently doing this by restoring organizations from SQL backups, but it is too long to complete each test run.
Update
So far, the best solution has been to create a user in the integration test, approve everything that we would need to approve, and then βclearβ by disconnecting the user and deleting his AD credentials so that we can reuse them - use these credentials for the next test run .
However, since we are only looking for a solution for a test environment, I would really like for you to have a solution that clears everything correctly: deleting records in SQL seems to be the way to go. However, due to the complex structure of the database, I was hoping that someone could provide scripts for this.
Update2
We created a script to manually remove the user from SQL (see accepted answer). This is not supported , so use it only in test environments if you know what you are doing.
source share