Hello, I am getting an error
Logon failure: unknown user name or bad password.
When I execute the following code in my VB application
Const ADS_UF_DONT_EXPIRE_PASSWD = &H10000
Dim uac
Dim objUser As New DirectoryEntry("LDAP://" & server & "/" & strDn, username, password, AuthenticationTypes.Secure)
objUser.Password = txtPassword.Text
objUser.CommitChanges()
uac = Fix(objUser.Properties("userAccountControl").Value)
objUser.Properties("userAccountControl").Value = uac Or ADS_UF_DONT_EXPIRE_PASSWD
objUser.CommitChanges()
at the line uac = Fix(objUser.Properties("userAccountControl").Value)
but it seems as if I get this error any time I try to access UAC.
I know the username and password are correct and not expired. I have tried multiple users including the domain admin. It sets the password without error. I seem to recall this working before???
Please Help!!!
How can I fix this? Thanks in advance for your time.
Robert H
P.S. I have logged in as AD\Administrator, AD.CONTOSO.COM\Administrator, and Administrator@AD.CONTOSO.COM
Computer OS: Windows XP
I have tried using the invoke method and got the same error
Logon failure: unknown user name or bad password.
When I execute the following code in my VB application
Const ADS_UF_DONT_EXPIRE_PASSWD = &H10000
Dim uac
Dim objUser As New DirectoryEntry("LDAP://" & server & "/" & strDn, username, password, AuthenticationTypes.Secure)
objUser.Password = txtPassword.Text
objUser.CommitChanges()
uac = Fix(objUser.Properties("userAccountControl").Value)
objUser.Properties("userAccountControl").Value = uac Or ADS_UF_DONT_EXPIRE_PASSWD
objUser.CommitChanges()
at the line uac = Fix(objUser.Properties("userAccountControl").Value)
but it seems as if I get this error any time I try to access UAC.
I know the username and password are correct and not expired. I have tried multiple users including the domain admin. It sets the password without error. I seem to recall this working before???
Please Help!!!
How can I fix this? Thanks in advance for your time.
Robert H
P.S. I have logged in as AD\Administrator, AD.CONTOSO.COM\Administrator, and Administrator@AD.CONTOSO.COM
Computer OS: Windows XP
I have tried using the invoke method and got the same error