Note that there are some explanatory texts on larger screens.

plurals
  1. POError changing password of user using WinNT string connection (and authenticating the current password)
    text
    copied!<p>I am developing a website which will authenticate the user and change the old password with new password. </p> <p>I am using WinNT string connection and setting password, without the old password check, works.</p> <p>My code is as below:</p> <pre><code>'actual setting password Dim entryD As New DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim NewUser As DirectoryEntry = entryD.Children.Find(username, "user") Dim nativeobject As Object = NewUser.NativeObject NewUser.Invoke("SetPassword", New Object() {strPassNew}) NewUser.CommitChanges() 'setting password ends </code></pre> <p>This works fine, but authentication code is not working.</p> <p>It is as below:</p> <pre><code>'authentication starts Dim adsiPath As String adsiPath = String.Format("WinNT://{0}/{1},user", domain, username) Dim userEntry = New DirectoryEntry(adsiPath, username, password, AuthenticationTypes.Secure) 'Dim nativeobject1 As Object = userEntry.NativeObject Dim newobj As ActiveDs.IADsUser = userEntry.NativeObject authent = True 'authentication ends </code></pre> <p>This authenticates but the exception which it throws is:</p> <pre><code>logon failure: unknown username or bad password </code></pre> <p>for the first time, but if i do it again the error is:</p> <blockquote> <p>"Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. "</p> </blockquote> <p>Which I don't want to happen... I don't want to use LDAP, I want a solution please, to authenticate the old password. Please help?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload