DotNetNuke, ASP.NET, Web Development Blog

DotnetNuke: Requiring Unique Passwords

DotNetNuke has a nice way to require unique passwords for all users. You can't simply go into the web.config, search for RequireUniqueEmail="False" and set it to RequireUniqueEmail="True". The problem is if there are already users with duplicate email addresses, bad things happen (It's been awhile since I've tried it and I don't remember specifically what happens but I know it wasn't handled well).

So, you need a way to remove the duplicate email addresses before you make the web.config change. This SQL will take care of it.

update Users set email = email + '.dup' where UserID in (SELECT min(userid) as userId FROM users
GROUP BY email HAVING ( COUNT(email) > 1 ))

This statement will append a ".dup" to the email address of the lowest userid for a duplicate set.

Some caveats:

  • This may effect the host account. You should review all changes addresses and make sure everything looks okay.
  • If there are still duplicates, you'll have to run the statement again and replace '.dup' with something else like '.dup2'.


Leave a Comment
Email: (not displayed)

Enter the code shown above:

Return to previous page