Granting Yourself Access to a Site

If you need to get administrative access to a site, but can’t (eg, because the original developer left), here’s how (this obviously assumes you have direct access to the db):

  1. Log into the site using your eID.  You won’t get access, but a record will be created in the db on your behalf.
  2. Run the following query in SSMS (or however else you connect to the db).  Obviously change the parameters first.  If you don’t know the SiteID, it can be gleaned from the mp_Sites table.   SELECT UserGuid, UserID FROM mp_Users WHERE LoginName = ‘your_ename’ AND SiteId = X
  3. Copy the UserGuid and UserID
  4. Next run the following query:  SELECT * FROM mp_Roles WHERE SiteID = X
  5. Copy the RoleGuid and RoleID of the role you want to grant the user (eg, for Admins)
  6. Next run the following query to insert a new record into the UserRoles table (obviously changing parameters first):  INSERT INTO mp_UserRoles VALUES (user_id, role_id, ‘user_guid’, ‘role_guid’);
  7. Finally, log out and back in again to the site in question; you should have access now.