Salut a tous
Voila j'aimerais chercher les info d'un utilisateur en me connectant a l'active directory
voici mon 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 25
|
'nom etant le persoid de l'utilisateur et dom etant son domaine
Sub ListUsers()
ADSPATH="LDAP://SF21-S01/DC=" & dom & ",DC=cm-cic,DC=fr"
chaine_complete=ADSPATH & ";(&(objectCategory=User)" & "(SamAccountName=" & nom & "));SamAccountName,AdsPath;dom"
Set objComputer = GetObject(chaine_complete)
objComputer.Filter = Array( "User" )
For Each objUser In objComputer
WScript.Echo "Name: " & objUser.Name
WScript.Echo "Fullname: " & objUser.Fullname
WScript.Echo "Description: " & objUser.Description
WScript.Echo "AccountDisabled: " & objUser.AccountDisabled
WScript.Echo "IsAccountLocked: " & objUser.IsAccountLocked
WScript.Echo "Profile: " & objUser.Profile
WScript.Echo "LoginScript: " & objUser.LoginScript
WScript.Echo "HomeDirectory: " & objUser.HomeDirectory
WScript.Echo ""
Next
End Sub
ListUsers() |
Lorque j'execute ca me met erreur 0x80005000 sur le ligne
Set objComputer = GetObject(chaine_complete)
Avez vous une idée du problème ?
Partager