Issue
After purging a user account completely from the system, customers may be unable to reuse the username that was tied to it. When attempting to create a new account with that username, the following error message is shown:
Cause
This is caused by the deleted user account still being present in the ASPnet application level of users.
Resolution
In order to fix this issue, you will need to delete any ASPnet records that do not have a corresponding record in the Users table within the DNN database.
Requirements: SQL access to the DNN server
NOTE: Please make a backup of your database before running this or any other SQL query.
1. Log in to SQL Server Management Studio.
2. In the left side Object Explorer, Double click on your server name and then Databases to expand.
3. Find your DNN database and right-click to select New Query.
4. Paste the following into the middle query box and then press F5 to execute:
SELECT UserID, Username
FROM aspnet_Users
WHERE UserName NOT IN (SELECT Username FROM Users)
SELECT UserID, Email
FROM aspnet_Membership
WHERE Email NOT IN (SELECT Email FROM Users)
This query will show you the accounts that are in ASPnet but do not have a corresponding record in the DNN database.
5. Execute the following query to delete those records:
DELETE FROM aspnet_Users
WHERE Username NOT IN
(SELECT u.username FROM Users u)
DELETE FROM aspnet_Membership
WHERE Email NOT IN
(SELECT u.email FROM Users u)
6. Clear your cache.
7. Validate the fix by attempting to create a new account using the username that was previously throwing the error. If successful, it should register without issue.
Comments
0 comments
Please sign in to leave a comment.