Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

DNN – Regain User Access

Posted on March 25, 2015October 26, 2015 By David Kittell

If you have ever been locked out of a DNN site you maintain (must have SQL access) this solution will help.

NOTE: If you don’t have SMTP settings configured this process will not help

First find your “Portals” table and update “UserRegistration” = 2
Note: In the example below I have “dnn” as my prefix, you may have something different

--Update dnn_Portals SET UserRegistration = 0 -- Turn Off Registration
--Update dnn_Portals SET UserRegistration = 1 -- Turn On Private Registration, make sure SMTP settings are configured correctly
Update dnn_Portals SET UserRegistration = 2 -- Turn On Public Registration
--Update dnn_Portals SET UserRegistration = 3 -- Turn On Verified Registration, make sure SMTP settings are configured correctly

Go to your site and register a new account

Example:
david account password is unknown, david1 account is the new account and you know the password

DECLARE @DNNOriginalUser VARCHAR(MAX)
	,@DNNNewUser VARCHAR(MAX)

SET @DNNOriginalUser = 'david'
SET @DNNNewUser = 'david1'

SELECT aU.[UserId]
	,[UserName]
	,[Password]
	,[PasswordSalt]
	,[LastActivityDate]
FROM [aspnet_Users] aU
INNER JOIN [aspnet_Membership] aM ON aU.UserId = aM.UserId
WHERE [UserName] = @DNNOriginalUser
	OR [UserName] = @DNNNewUser

Run this script below and you should be able to log in again.
NOTE: As always run a backup of your database before you try this script.

DECLARE @DNNOriginalUser VARCHAR(MAX)
	,@DNNNewUser VARCHAR(MAX)

SET @DNNOriginalUser = 'david'
SET @DNNNewUser = 'david1'

UPDATE aspnet_Membership
SET [Password] = (
		SELECT aM.[Password]
		FROM aspnet_Membership aM
		INNER JOIN [aspnet_Users] aU ON aU.UserId = aM.UserId
		WHERE [UserName] = @DNNNewUser
		)
	,[PasswordSalt] = (
		SELECT aM.[PasswordSalt]
		FROM aspnet_Membership aM
		INNER JOIN [aspnet_Users] aU ON aU.UserId = aM.UserId
		WHERE [UserName] = @DNNNewUser
		)
FROM aspnet_Membership
INNER JOIN [aspnet_Users] ON [aspnet_Users].UserId = aspnet_Membership.UserId
WHERE [aspnet_Users].UserName = @DNNOriginalUser

Reference: http://www.deutschnetnuke.de/tabid/183/Default.aspx

Originally Posted on March 25, 2015
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code DNN MSSQL - DNN

Post navigation

Previous post
Next post

Related Posts

Subscribed Web Alert

Posted on August 6, 2013October 26, 2015

Will return you all the web alerts. The ID column represent the ID for the web alert SELECT * FROM subscriptions_tbl Will return you the folder(s) where the web alert is assigned The column Value_number represents the ID column from subscriptions_tbl The column Object_ID represents the folder ID where the…

Read More

PowerShell – Change Windows CD/DVD Drive Letter

Posted on May 14, 2018

# Set CD/DVD Drive to A: $cd = $NULL $cd = Get-WMIObject -Class Win32_CDROMDrive -ComputerName $env:COMPUTERNAME -ErrorAction Stop if ($cd.Drive -eq "D:") { Write-Output "Changing CD Drive letter from D: to A:" Set-WmiInstance -InputObject ( Get-WmiObject -Class Win32_volume -Filter "DriveLetter = ‘d:’" ) -Arguments @{DriveLetter=’a:’} } # Set CD/DVD Drive…

Read More

PHP WordPress – Use Radius Server Login

Posted on October 27, 2015November 19, 2015

Securing WordPress with Radius Server login. This project was created in mind to help secure WordPress but allow users an easier way to securely login without having to have a really long password to remember. While I do not go into creating the Radius server you can go to http://www.radiusdesk.com/getting_started/install_ubuntu_nginx…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
©2025 David Kittell | WordPress Theme by SuperbThemes