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):
- Log into the site using your eID. You won’t get access, but a record will be created in the db on your behalf.
- 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
- Copy the UserGuid and UserID
- Next run the following query: SELECT * FROM mp_Roles WHERE SiteID = X
- Copy the RoleGuid and RoleID of the role you want to grant the user (eg, for Admins)
- 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’);
- Finally, log out and back in again to the site in question; you should have access now.