Jump to content

Recommended Posts

Posted

I am looking for a asp / asp.net code snippet that will I can enbed in a student password reset page for staff. My current code performs a winNT password reset, but that requires the existing password for the user.

 

What I want to be able to do is get a member of staff to log on using their credentials (they have delegated rights) and reset students passwords looking up the username from a drop down list.

 

Any ideas?

Posted

Resetting the password in ASP.NET is simple enough so long as you know the DN of the account you're resetting:

Imports System.DirectoryServices

Dim sDN As String = ""
Dim sNewPassword As String = "newpassword"

Dim oEntry As DirectoryEntry = New DirectoryEntry("LDAP://" & sDN)
oEntry.Invoke("SetPassword", sNewPassword)

 

To enumerate the AD to retrieve a list of DNs and associated usernames, take a look at the DirectorySearcher class.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...