2009-05-06 2 views

답변

0

나는 그것을 해본 적이 없다,하지만 난 ADO를 통해 LDAP 쿼리를 포함 읽었습니다,하지만 실제 공급자 이름 또는 필요한 연결 문자열을 모른다. 이 사이트에서 AD에 대한 LDAP 쿼리에 대한 기사를 검색하여 몇 가지 예를 찾을 수 있습니다. Access 답변이 아니지만 Access에서 수행 할 작업을 표시 할 수 있습니다. 이 같은

2

시도 뭔가 :

'Use ADO and LDAP to return all users in Active Directory 
Dim objRecordSet As Object 
Dim objCommand As Object 
Dim objConnection As Object 

Const ADS_SCOPE_SUBTREE = 2 

Set objConnection = CreateObject("ADODB.Connection") 
Set objCommand = CreateObject("ADODB.Command") 
objConnection.Provider = "ADsDSOObject" 
objConnection.Open "Active Directory Provider" 
Set objCommand.ActiveConnection = objConnection 

objCommand.Properties("Page Size") = 1000 
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE 
objCommand.Properties("Sort On") = "Name" 

objCommand.CommandText = _ 
    "SELECT Name FROM 'LDAP://dc=<enter domain controler server name here>,dc=<enter full AD domain name here>' WHERE objectCategory='user'" 
Set objRecordSet = objCommand.Execute 

objRecordSet.MoveFirst 
Do Until objRecordSet.EOF 
    Debug.Print objRecordSet.Fields("Name").Value 
    objRecordSet.MoveNext 
Loop 

이 사용자의 목록을 얻어야한다. 도메인 컨트롤러 서버 이름과 AD 도메인 이름을 제공해야합니다.

희망이 액세스와 마크

관련 문제