Authentification avec un LDAP
Bonjour à tous,
Le code suivant devraient normalement être fonctionnel mais non :?
Le problème est que quand je rempli la variable strPassword (avec le bon mot de passe je vous rassure), j'ai une erreur -21470166. Par contre, avec la variable vide, cela fonctione 8O Une idée ?
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
On Error Resume Next
Dim DSODomaine
Dim DSOContainer
strLogin = "login"
strPassword = ""
Set DSODomaine = GetObject("LDAP:")
wscript.echo "Erreur : " & err.number & " " & err.description
Set DSOContainer = DSODomaine.OpenDSObject("LDAP://monserver/ou=yyyy,o=xxx",strLogin,strPassword,ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND)', strLogin, strPassword, 1)
If Err.Number <> 0 Then
' indebug ("Connection failed : LDAP://" & strDC & ", " & strDomain & "\\" & strLogin & ", ********")
LDAPIdentif = False
Else
LDAPIdentif = True
End If
wscript.echo "Résultat : " & LDAPIdentif
wscript.echo "Erreur : " & err.number & " " & err.description
Set DSOContainer = Nothing
Set DSODomaine = Nothing |