Deleting a user from a specific DNN portal through SQL

Overview

In the course of working with DNN, you may need to remove a user account from a specific site portal but not any others. It may be that this particular portal account has incorrect permissions and you need to rebuild the account from the beginning or you just need to revoke the user access altogether.

 

Prerequisites

 

Solution

1. With your SuperUser/Admin account, login to your EVOQ instance and use the Persona Bar to select Settings > Site Settings

sitesettings.jpg

2. On the following site settings screen, select the portal you would like to delete the user from via the portal drop-down at the top of the page and take note of the Portal ID Number (in the screenshot below, the ID number is 0.)

portalinfo.jpg

3. Go back to your Persona Bar and select Settings > SQL Console

4. You will need to run the following SQL query to find the User ID of the user you would like to delete:

Select * from Users where Username='ENTER_THE_USERNAME_YOU_WANT_TO_DELETE_HERE'


The output of this will be:

userID.jpg

Take note of the UserID.

5. Now that you have the PortalID and the UserID you will need to validate that this is the correct account with the following SQL query:

select * from UserPortals where PortalId='PUT_PORTAL_ID_HERE' and UserId='PUT_USER_ID_HERE'


Validation can be found in the query output here:

validate.jpg

6. Once you have validated, run the following SQL query to delete the user account from the specific portal:

Delete from UserPortals where PortalId='PUT_PORTAL_ID_HERE' and UserId='PUT_USERID_HERE'

The output of the query will be as follows:

result.jpg

7. Go to Settings > Servers from your Persona Bar. Click on Clear Cache and then Restart Application.

This however will not remove the entire user as the user information will still exist, it will just not exist for that particular portal. If you would like to permanently delete the user, you will need to delete the user account through the UI for all portals.

 

Testing

To validate that the account has been deleted, login to the specific portal as an Admin/SuperUser and use the Persona Bar to select Manage > Users. The user account should no longer be listed there. 

Comments

0 comments

Please sign in to leave a comment.