1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
' --- Lecture du DN du domaine de recherche
' Set objRootDSE = GetObject("LDAP://" & serv_AD & "/rootDSE")
' strDomainDN = objRootDSE.Get("rootdomainNamingContext")
' --- On construit l'emplacement de recherche
strADsPath = "LDAP://" & serv_AD & "/" & site_DN_domaine ' strDomainDN
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject", site_uid_adm_win_AD & "," & site_DN_domaine, site_pwd_adm_win, 0
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.CommandText = "<" & strADsPath & >;(&(objectCategory=User)" & _
"(samAccountName=" & cpt_search & _
"));samAccountName,ADsPath,displayName;subtree"
Set objRecordSet = objCommand.Execute
.... |
Partager