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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Adding Users Programmatically via SQLAdding Users Programmatically via SQL
Previous
 
Next
New Post
8/16/2007 3:58 PM
 

I am creating a site for employees.  Each employee will have a couple of pages.  Since there are over 4000 employees, and I am lazy and don't want to manually create pages for each user, I am planning to set it up programmatically by adding tabs, modules, roles and users via sql.

I have succeeded in adding the tabs, modules and roles via sql, but hit a snag with adding users.

I have added a user  to the User, aspnet_Users, and aspnet_Membership tables via sql.  But the login doesn't work, and the user is not found under Admin Accounts in the interface.  Is there another table I need to add data to?

One confusing problem is that the aspnet_membership and aspnet_users tables have a GUID for the UserID.  Not at all sure what that is about.  I created a unique GUID for my user, and used the same GUID in both tables, but it didn't help.

Am I missing something?  Does someone know of a way to programmatically add users?  I am NOT using Active Directory logins, just a username and password.

Thanks in advance ...

 
New Post
8/16/2007 4:45 PM
 



jno,

When it comes to importing bulk users and role data, there is no reason to put users in one-by-one.
Of course if you are familiar with sql management studio or sql managment studio express, you can bulk import any data.
Whether blog, forum, user, etc.  To do this you do need hosting permissions within sql managment studio & database, which isn't always the case.
Basically if you can right click on database and see option for Tasks > Import data, your in. A wizard pops up and prompts a bunch of different location
questions and even this section can be confusing to newbies. I would recommend testing on a dead site and trial and error results.

But, what I would recommend for you, and have personally used, is a module by the name of BulkReg.
Get it, Bulk Register. ANyway you can find this by doing search on www.snowcovered.com

This module will bulk import users, as well as populate roles, and place user within desired roles.
Exactly what you are looking for. All in one location.  Remember it being affordable too!
There are a few things to learn when using this module, but all the help you need is in help file.

Glad to help,

-machina12

 
New Post
8/16/2007 6:17 PM
 

John Mitchell wrote a program to do this.

It will probably need a bit of tweaking but it works great.  I imported 300 users yesterday to my site based on a modified version of his posted code.

http://blogs.snapsis.com/PermaLink,guid,c9d3082b-d7b1-4dfb-8c9c-67c0e864964d.aspx

Stuart Hilbert


Hilbert Solutions, LLC
Owner, Hilbert Solutions, LLC
http://www.HilbertSolutions.com
A DNN Service Provider
From Module Development to DNN Upgrades, your one stop DNN Shop
 
New Post
8/16/2007 8:03 PM
 

I recommend DnnMasters User Import Module. It's like sliced bread.

 
New Post
8/17/2007 4:47 AM
 

You also need to add a record in UserPortals to link the Users record to the Portals record for the site the user is allowed to access.

Then you need to add a record to UserRoles to link the Users record to the Roles record for the Registered Users role (look up the RoleID for this in the Roles table).

Your user should show up after this, but it won't have a user profile. You can complete this by adding records to UserProfile.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Adding Users Programmatically via SQLAdding Users Programmatically via SQL


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