I am trying to cerate a VB program that will allow the user in AD to change their password. We are using Terminal Services and have disabled the ctrl-alt-del function. Basically I have some code from a VB Script I wrote that will get the user information from the system and use that information to connect to LDAP. I have seen code using similiar commands in use around the net so I think I have it right. I just believe that I am missing a reference library. Below is the code from my Change Password button. Most of the code that is giving me problems is remarked out. Do I need to use a certain reference library in order for this to work?
Thanks,
Rick
Dim strUserDN
Dim objUser
Dim strOldPass, strNewPass1, strNewPass2
'strUserDN = objSysInfo.userName
'objUser = GetObject("LDAP://" & strUserDN)
strOldPass = TextBox1.Text
strNewPass1 = TextBox2.Text
strNewPass2 = TextBox3.Text
If strNewPass1 = strNewPass2 Then
'objUser.ChangePassword(strOldPass, strNewPass1)
'objUser.pwdLastSet = 0
'objUser.lockoutTime = 0
'objUser.SetInfo
MessageBox.Show("Passwords Match, Way to go Skippy!!")
'Reset Variables
strOldPass = ""
strNewPass1 = ""
strNewPass2 = ""
'End the program
Me.Dispose()
End If
If strNewPass1 <> strNewPass2 Then
MessageBox.Show("Passwords do not match. Please enter again.")
End If
Thanks,
Rick
Dim strUserDN
Dim objUser
Dim strOldPass, strNewPass1, strNewPass2
'strUserDN = objSysInfo.userName
'objUser = GetObject("LDAP://" & strUserDN)
strOldPass = TextBox1.Text
strNewPass1 = TextBox2.Text
strNewPass2 = TextBox3.Text
If strNewPass1 = strNewPass2 Then
'objUser.ChangePassword(strOldPass, strNewPass1)
'objUser.pwdLastSet = 0
'objUser.lockoutTime = 0
'objUser.SetInfo
MessageBox.Show("Passwords Match, Way to go Skippy!!")
'Reset Variables
strOldPass = ""
strNewPass1 = ""
strNewPass2 = ""
'End the program
Me.Dispose()
End If
If strNewPass1 <> strNewPass2 Then
MessageBox.Show("Passwords do not match. Please enter again.")
End If