I have a SQL script (which was previously published on this page) which will allow you to delete a user fully and completely from Microsoft Dynamics CRM 4.0. It is, of course, utterly wrong and unsupported to do this, but still – the script exists and seems to work just fine.
I originally wrote it to carry out some particularly unsupported work with a previous client. Later on, I found use for it on more than one occasion during my own development (specifically when importing clients’ existing databases into my own Virtual Machines).
I’ve pulled the script from here but will happily provide it to anyone who specifically requests it. I have removed it since even my own tenuous example of how it might be useful turned out to be overengineered. I had suggested that deleting users might be an easy option when importing databases full of users into a development environment, but where you the developer don’t want the overhead of creating AD accounts and then mapping those users. Ivan (comments, below) has correctly pointed out behaviour which I was previously aware of but had slipped my memory: mapping users is not mandatory during the “Import Organisation” process (well, you need to map at least one user, but otherwise…). Despite showing an “Error” during the mapping process, so long as at least one user has been mapped, one can opt to ignore the issue and proceed with the import. ThankĀ you Ivan.
This makes the script even less tenable than I had thought, so I decided to take it offline. Still, if you want a copy drop me a line – just be aware that the reason you can’t delete a user in CRM is that there are usually different ways to approach the problem.




Wow. This script is pretty dangerous! I hope people read the article before stealing your script.