Hi Guys im writing a little app to enable authorised staff to reset student passwords but having a few issues. . I am no expert and am now stuck!

The following code does not seem to error but also does not reset the password!

_________________________

Private Sub bt_pwd_reset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bt_pwd_reset.Click

tb_newpwd1.Text = GenPassword.ToString

Try

Dim username As String = TUserName.Text
Dim de As DirectoryEntry = New DirectoryEntry()
de.Path = "LDAP://10.33.0.25/OU=Staff_Users;dc=domain,dc=domain,dc=internal"

de.Username = "DOMAIN\username-admin"
de.Password = "domainpassword"

de.AuthenticationType = AuthenticationTypes.Secure

Dim deSearch As DirectorySearcher = New DirectorySearcher(de)
deSearch.SearchRoot = de
deSearch.Filter = ("(sAMAccountName=" & username & ")")
Dim results As SearchResultCollection = deSearch.FindAll()
If results.Count = 0 Then
message.Text = "Can not locate user name: " & username
message.Visible = True
Exit Sub
End If



With de
.InvokeSet("serPassword", "Password123")
' .Invoke("SetPassword", Password123)
.CommitChanges()
End With

de.Close()

Catch ex As Exception
message.Text = ex.ToString
End Try
lb_bigpwd.Text = tb_newpwd1.Text
End Sub

______________________________________________

Any help on this would be great!!

Thanks in advance
Anthony