The CRM Grid – A Microsoft CRM Blog

Greg Owens’ rose-tinted MS-CRM mumblings

Deleting Users in MS CRM 4.0

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.

Advertisement

32 Comments»

  kreed wrote @

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

  Greg Owens wrote @

Absolutely it is – in fact I think I’ll add some more bold warnings to the start.

  Ivan wrote @

Im pretty sure you can also press next and skip the mapping prompt. That is more of a warning than a stop prompt, they should change the icon.

  Donald wrote @

Can you mail me this apparently very dangerous script please

  Steveo wrote @

Hello can I also have a copy of the script, I am importing a large existing databases into my VM and after applying all the hotfixes etc and three days later I am still looking at the ‘Update Users’ message on the import organization wizard. I don’t need any of the users for what I want to do. Thanks (hopefully in advance)

  -kNuCkleS- wrote @

Hello, thank you for the post.
I’m interested in the script too, can you send me the query please?

  Deniz wrote @

Hi,

Can I have also this script please ?, it can be dangerous but thats the way of life, if used carefully, why not using it..thanks in advance

  Prakash wrote @

HI,

Could you please give me your scripts for deleting users as it is highly mandatory to me in the current situation.

Regards,
Prakash

  Pradeep Ranganath wrote @

Can you please send me the scripts. I am very much in need of this.

  sudheer wrote @

can u please send me the script

  Paul Greg wrote @

Could you please send me the script. I need to delete a user.

  Mario Butler wrote @

Could I get the script please for deleting CRM users.

I’m having an issue with importing an organization into a development environment from production where 4 users were deactivated and removed from active directory and I can’t get past the user mapping screen.

  Greg Owens wrote @

Mario are you sure you need this? As Ivan points out (comment #3), despite CRM showing an error message during import, it is possible to continue even though your 4 users no longer exist.

Please confirm if you still have a problem :)

  Mahbubur Bhuiyan wrote @

Would you please send me the script to delete CRM users. Thanks

  Abhishek Ranjan wrote @

Hi,
Can you please send me the script for deleting the users?

Thanks

  Kathy Jantz wrote @

Could I get a copy of the script to delete CRM users? Thanks.

  Greg Owens wrote @

Many thanks to Kathy – unbelievably, the first person out of the many I have sent this script to, who actually had the courtesy to acknowledge receipt and thank me.

  Jason wrote @

Could i have a copy of the script to delete CRM users?

I’m working on an unsupported method of inserting users who no longer have AD accounts but need to be migrated from a legacy system, and being able to delete a user is clutch for my testing purposes!!

Thanks!

  Carlos wrote @

Please send me the script. Thanks.

  jabacrm wrote @

Thanks for your work. Please send me the script as I have an unusual issue – two users were set up in AD with the same email address, and CRM now has dupe user email addresses. This is causing issues with validation for Outlook Appointments.

Thanks.

  Greg Owens wrote @

Happy to send you the script but are you sure you need it? You could edit the user record in CRM (Settings > Administration > Users) and change the email address on one of the records. Alternatively, just deactivating one of the user records in CRM (if it is not needed) would suffice.

Let me know if the script is still needed :)

  Tin wrote @

Hi Can I also have the script? I have issue with the user account.

Thanks :)

  Karthik wrote @

Hi there,

Can you please send me this scrip as soon as possible. I have a user account issue on my current CRM 4 system regarding enabling/disabling and want to try this out.

Cheers :)

  Jonas wrote @

Can I get your script please.thanks.

  Amit wrote @

Hi,
If I choose to perform the import organization procedure, (and ignore the warning regarding users that are not mapped), what will happen to these users records, and their related (owned) records in the upgraded CRM?
Are these records deleted during the import organisation procedure? and if not, will these records still be accessible in the CRM?

Thanks,
Amit.

  Mark wrote @

Hello there, great article. Could i get a copy of the script please? Many thanks in advance.

  Parag Bhambure wrote @

Could I get a copy of the script to delete CRM users? Thanks

  Chris wrote @

Could I please get a copy of the script? Many thanks!

  Nabile wrote @

Please, could I have your SQL script to delete the user too?

  sebastian.mayer.67 wrote @

Hi, I would like to get the script.

  Sumit wrote @

Could I get the Copy of the scripts please, Thanks in Advance

  jm wrote @

can you send to me please? This is crazy that they won’t build a delete function that auto-reassigneds, cleans up, and lets us maintain our sanity !!! I am not looking forward to doing an actual upgrade to 2011..


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.