Remove All Deleted Users IN DNN 7.3.2-7.3.4

Rating:        Based on 4 ratings
Reviewed:  4 reviews
Downloads: 400
Released: Sep 10, 2014
Updated: Jan 17, 2015 by leupold
Dev status: Stable Help Icon

Recommended Download

Application RemoveAllDeletedUsers.sql
application, 10K, uploaded Sep 10, 2014 - 333 downloads

Other Available Downloads

Application RemoveAllRegisterNotifications.sql
application, 2K, uploaded Jan 17, 2015 - 67 downloads

Release Notes

This script creates and executes a procedure to finally remove ("hard delete") users, which are marked as deleted ("soft delete").
Supports to specify a single or all portals.

Companion script DeleteAllRegisterNotifications may be run as well to dismiss all existing admin notifications about new registrations or users deleted.

Reviews for this release

Thanks Sebastian!!! I have not run this yet, but the script looks like the same thing I have had to do three times now manually on different sites hit by spammers.
by ecsmith62 on Jan 22, 2015 at 1:37 AM
Thanks, Sebastian. The script worked a treat. As with others (ref: ) I have had problems with SPAM - this removed the 519 mescreants from the portal database :) ... Just need to figure out how to delete the associated notifications... Regards, Duncan.
by thectosian on Jan 16, 2015 at 4:24 PM
The script ran with the following error... System.Data.SqlClient.SqlException (0x80131904): The DELETE statement conflicted with the REFERENCE constraint "FK_UserRelationships_Users_OnRelatedUser". The conflict occurred in database "SDMarketingDev", table "dbo.UserRelationships", column 'RelatedUserID'.
by steve_atlanta on Dec 8, 2014 at 6:03 PM
I am in the process of trying to use this script. I only have one question. For 50,000 Users, how long will it take if run by logging into the website as the SuperUser and running via HOST-->SQL. I pasted the entire document without replacing anything. When I tried to replace databaseOwner and objectQualifier via HOST --> SQL it replied, error. When I simply cut and paste, it appeared to be working as the hour class simply kept turning and turning and never came back with an error. Thank you for creating this script. Even if it doesn't work, you are trying to help the world fix this problem and that makes you AWESOME in my book. I'm going to let it run all night and check to see if anything happened and I will let you know and will come back and give it either 5 stars for IT WORKS or 3 stars for IT DOESN'T WORK. UPDATE: Never wrote a line of SQL code. I am a complete NOVICE and all I did was cut and paste Sebastian Leupold's code by going into HOSTS--->SQL after copying it and it was able to get rid of ALL soft deleted accounts. Thank you Sebastian Leupold for creating this code and helping people. I am telling everyone I know that YOU are the MAN!!
by kennyraystika on Sep 12, 2014 at 3:31 PM
Kenny, you need to replace variables only if running in a database tool like SQL Server Management Studio (Express), DNN will perform those substitutions, if run from Host > SQL. The script should just run seconds or a few minutes, even to delete ten thousands of users. NOTE: delete from users table may fail, if a 3rd party extension placed a relationship on it without cascading delete (although being told, not to do so). I am glad, If I was able to help :)
Reply by leupold (N/A) on Sep 14, 2014 at 6:15 PM