Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Deleting Users From DatabaseDeleting Users From Database
Previous
 
Next
New Post
11/18/2008 11:00 PM
 

 I have a local instance of a DNN portal v4.06.02 where I need to run a database script to delete a huge chunk of the users.  Looking through the DNN source, I know that I need to delete the users in a specific way and order.  I have that order below.

-- delete user roles
EXEC [dbo].[DeleteUserRole] @UserId, @RoleId
-- delete user
EXEC [dbo].[DeleteUser] @UserId
-- delete membership user
EXEC [dbo].[aspnet_Users_DeleteUser] @ApplicationName, @UserName, @TablesToDeleteFrom

That part is easy enough in theory. It is pretty obvious where and how to delete the objects in the first two steps. However, the deletion of the membership user is not as straightforward.  It requires the Application Name.  I can see in the aspnet_Applications table what the application name is, but that would force me to hard-code it.  What I need to do is figure out where the data join is made between the DNN data and the aspnet provider data.

Additionally, what is an appropriate value for the @TablesToDeleteFrom argument?


Will Strohl

Upendo Ventures Upendo Ventures
DNN experts since 2003
Official provider of the Hotcakes Commerce Cloud and SLA support
 
New Post
11/18/2008 11:10 PM
 

 Hey Will,

This isn't a direct answer to your question, but in the past when I've needed to delete a bunch of users, I've found it much easier to add an ASPX page to my DotNetNuke website and have it call DotNetNuke's API for deleting a user.  This way I dno't have to worry about all of teh tables things live in.

 
New Post
11/18/2008 11:12 PM
Accepted Answer 

Will, I've done this in the past to delete a large number of users:

1. Run this SQL: Update UserPortals set Authorised=0 where UserId in [... select whichever users you want to delete ... ]

2. Go to Admin | User Accounts and click the "Delete Unathorized Users" button.  Wait a little bit and they will be all gone.  Let DNN do all the work for you.

JK.


You know your website is cool, so why not let your users help you by spreading the word on social networking sites - get the DotNetNuke Social Bookmarks Module with 57 different ways to add social bookmarks to your site ... or download the FREE demo right now
 
New Post
11/18/2008 11:29 PM
 

Clever, JK. Don't have to worry about figuring out the business layer. That's always right when possible, in my book.


pmgerholdt
 
New Post
11/19/2008 2:05 AM
 

also... i think the asp.net application name is always DotNetNuke


Erik van Ballegoij, Former DNN Corp. Employee and DNN Expert

DNN Blog | Twitter: @erikvb | LinkedIn: Erik van Ballegoij on LinkedIn

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Deleting Users From DatabaseDeleting Users From Database


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out