How to expire the temporary password user has not Login Immediately after certain period in FBA


Hi ,
i am using this solution, one able send the email to concern person after his completion of his registration process. what my requirement. if user does not change his immediately i need to expiry the temporary password which i sent to his mail

I think the easiest solution would be to run some sql periodically on the aspnetdb database on sql server. You can schedule it with SQL Server Agent.

Something that checks the membership table if the created date is > 4 hours (or some period of time) from now, and if the password change date matches the created date, then set isapproved to 0.

thanks for your Reply

i am check like this

update aspnet_Membership set IsApproved=0
where DATEDIFF(hh, GetDate(), LastPasswordChangedDate)>4 and

if the same user aging click on the forgot password link and generating the new password . he is not able to login. IsApproved is 0 . how can i make it it 1 when the user clicks agin forgot password links once his password expiration time

You could customize the forgot password web part to unlock the user when it's used. Of course, in that case you should probably use IsLockedOut instead of IsApproved, to prevent users who are really supposed to be inactive from activatingt themselves.

hi is there any alternate to Sql Job if we run the sql job there is some Performance issue . i am running some Stored procedure using Sql server Agent. but its looks like some performance can u tell any other approach we can do in code its self

I guess you could retrieve all users in the code itself, and then loop through each user, checking for the last password change date, and then unapproving them in the code. The sql method should be faster though - I would think it should run nearly instantaneously, unless you have a ton of users.