Tuesday, January 16, 2018

DELETE USER FROM CRM - via SQL commands (DATABASE)


DELETE USER FROM CRM – via SQL commands (DATABASE)
I would like to delete CRM User and not disable the user.  Because of that I must to remove the current user from some CRM tables.
This is unsupported way for the resolution. Be sure to take a backup of both config DB and CRM DB.

The unsupported command helps to remove this CRM user
  1. Select SystemUserId from systemuser table
Run the next command:
select SystemUserId from SystemUser where DomainName like '%Test\Test%'
Save the guid for all other commands.
  1. Run the next commands in the orgaxniation Db for instance TEMP_MSCRM
DELETE dbo.SystemUserProfiles  where  SystemUserId = 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
DELETE dbo.UserSettingsBase   where  SystemUserId = 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
DELETE dbo.QueueMembership  where  SystemUserId = 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
DELETE dbo.TeamMembership  where  SystemUserId = 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
DELETE dbo.xnes_auditBase  where  xnes_user = 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
DELETE dbo.xnes_crmlogBase where  xnes_owner = 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
DELETE dbo.SystemUserRoles where  SystemUserId = 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
DELETE SystemUserBase where  SystemUserId = 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'

  1. Run the next command in MSCRM_CONFIG DB
delete   SystemUserOrganizations  where CrmUserId = 'AAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'

Needs to IISRESET CRM front servers.
The reason is changes in MSCRM_CONFIG DB

Enjoy,

Rami Heleg

Monday, January 2, 2017

Add Entity to queue return error message: This object type cannot be added to a queue

Add Entity to queue return error message
{"This object type cannot be added to a queue."}

Solution should be very sample..
just update entity attributes under Communication @ Collaboration to support Queue



Thanks,
Rami Heleg