Thursday, May 27, 2010

Autostart application that requires UAC on user logon in windows 7 without verifying them

I wanted to make windows autorun some application (like openvpn-gui and SQL 2005 Service Manager) whenever I logged in in order to have them loaded in the tray. Placing them in the Startup folder would autostart them but I had to confirm both of them in the UAC (User Account Control) since they both run as administrator. In order to bypass this, I had to schedule them in the windows scheduler. In order to do so you must follow the following steps.

Tuesday, May 18, 2010

Hard reset password on membership provider (applied to DNN)

I just moved a DNN (DotNetNuke) installation from a computer to another and restored the database in order to be able to work locally. DNN uses Membership as its default security provider thus I could not login to the web site (all passwords are encrypted using the local machine key). In order to override the password I wrote the following lines of code:
Dim mu As MembershipUser = Membership.GetUser("MyUserName")
mu.ChangePassword(mu.ResetPassword(), "mytoughpassword")
In the default page’s init event. This is the way to programmatically change any membership account’s password.

Happy coding and don't forget to delete the above mentioned lines after reseting the passwords!