ASP.Net Membership add user & role utility

How many time do find you can’t easily add new user to your application when deploying. It’s ironic that you have built an asp.net application with a complete user management features but can’t get it to work because you need to login the first time around to access the features.

Or may be you can’t be bothered to create one, just want to create a few roles or users. We all know that we can’t  make ASP.Net web admin tools to work on a remote site.

This utility is meant to add a new user or roles to your newly create aspnet identity database.

to use just compile the source with .Net 4.0. the use this command line switchers

 

To add new user

  • -u username
  • -p password
  • -e email
  • -r role (if you have more than 1 role for the user, do it multiple times)
  • -c the path to the configuration file, i.e. your web.config

To add new roles

  • -r roles
  • -c the web.config file

This work by creating a new appdomain, and loading the config file , since there’s no programmatic way to access the Membership features(or I just can’t find it). See the source for details. You can safely delete the app.config

 

Download the source here

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: