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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Script to delete all non-AD users?Script to delete all non-AD users?
Previous
 
Next
New Post
2/18/2009 12:51 PM
 

Would it be possible either by a script (or some other method that could be automated) to go in and delete all user accounts not part of our domain?  (Or- since all usernames get a DOMAIN\ added to their username, deleting anyone not having that as part of their name...)

The brief explination as to why: We've got some module that uses DNN User Accounts. We don't like this, but there is no way around that in the module at the moment, so we have to allow people to register.  We don't want them cluttering up our list of User Accounts, and DNN Authentication is turned off so they can't log back in using that account anyway.  They're single-use.  The idea was suggested that if we could automatically purge the users things would be kept clean, and we wouldn't run into any issues should a returning visitor decide to try to re-register and be met with a "name already exists" error, making them pick yet another username.  Kind of half-assed, but it's the best workaround we've been able to come up with.

Thanks.

 
New Post
2/18/2009 5:05 PM
 

Would a query directly to the database be acceptable here, or can I screw something up plucking users out like that?

If it's safe to just delete users out of the database, would omething like  DELETE FROM dnn_Users WHERE Username NOT LIKE 'DOMAIN%'   do it?  

(I think...  may have to tweak the syntax. Haven't written one in a while...)

 
New Post
2/18/2009 5:45 PM
 

That might work but it wouldn't totally remove those users as there's information stored about the user in other tables. I used to have a script at home that I used to remove users from all of the tables but I'm not sure if I still have it. I'll check tonight when I get home.

 
New Post
2/19/2009 2:07 PM
 

Ah... I see. Stuff in (at least) UserProfile and UserRoles too.  Hmn.  So any script would have to check the UserID, too, to get 'em out of the other tables.

 

 

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Script to delete all non-AD users?Script to delete all non-AD users?


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