Showing posts with label System Administrator;Role. Show all posts
Showing posts with label System Administrator;Role. Show all posts

Wednesday, April 14, 2010

Lost the only System Administrator User defined in the System :(

The story goes, the system had only one user that was assigned the System Administrator Role, to avoid giving blanket rights to many in the organization.


Unfortunately, this user (the only System Administrator) goes ahead and takes the role off their user. Cool… Now we are left with no System administrator user in our CRM system.

System Administrator happens to be the only user with the privileges to assign roles to a user in CRM.

With no System administrator in the entire system, it was as if we were locked out as no one had any rights to make anybody the system administrator.

The only workaround, though unsupported, worked for us is to make a couple of updates to the tables directly from the backend.

select * from SystemUserBase where FullName='System Administrator'

From this query we was able to get the “Systemuserid” of the “System Administrator”

Now use this “systemuserid” in the below query:
select * from SystemUserRoles where SystemUserId='3B0574CE-A5EE-DD11-BDF0-0003FFEB167C'

From the above query we got the total roles associated with the “System administrator”.

Now find the roleid of “System Administrator” role by the below query.
select * from RoleBase where Name='System Administrator'


Now we have to update the “systemuserroletable”. We will update the roleid of the first row to roleid of “System Administrator” role.

update SystemUserRoles set RoleId='B6F673CE-A5EE-DD11-BDF0-0003FFEB167C' where SystemUserId='3B0574CE-A5EE-DD11-BDF0-0003FFEB167C'
and SystemUserRoleId='01ACF23C-D23C-DF11-A664-0003FFD1167C' and RoleId='6D0274CE-A5EE-DD11-BDF0-0003FFEB167C'

Do the “IISRESET”

Now the “System Administrator” has the “System administrator” role.

However, the “CSR Manager” role is missing because we have updated this roleid by “System Administrator” roleid in “SystemUserRoles” table.
But now we do have the manage roles button to allow us to add this role back again


To be used at your own risk and only if you are locked out of your own system.