Created
March 22, 2013 18:14
-
-
Save bdukes/5223509 to your computer and use it in GitHub Desktop.
Clear out orphan users from DNN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE UserProfile WHERE UserID IN (SELECT UserID FROM Users WHERE UserID NOT IN (SELECT UserID FROM UserPortals) AND IsSuperUser = 0) | |
DELETE aspnet_Membership WHERE UserId IN (SELECT UserId FROM aspnet_Users WHERE UserName IN (SELECT UserName FROM Users WHERE UserID NOT IN (SELECT UserID FROM UserPortals) AND IsSuperUser = 0)) | |
DELETE aspnet_Profile WHERE UserId IN (SELECT UserId FROM aspnet_Users WHERE UserName IN (SELECT UserName FROM Users WHERE UserID NOT IN (SELECT UserID FROM UserPortals) AND IsSuperUser = 0)) | |
DELETE aspnet_Users WHERE UserName IN (SELECT UserName FROM Users WHERE UserID NOT IN (SELECT UserID FROM UserPortals) AND IsSuperUser = 0) DELETE Users WHERE UserID NOT IN (SELECT UserID FROM UserPortals) AND IsSuperUser = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment