Re: LDAP query for the entire domain
- From: "Nuevo" <imaneophyte@xxxxxxxxx>
- Date: Thu, 14 Sep 2006 16:02:36 -0400
I'm using a proprietary tool that expects the LDAP query to conform to
syntax standards which is one of the reasons I'm having problems with the
structure.
Thanks.
"Paul Williams [MVP]" <ptw2001@xxxxxxxxxxx> wrote in message
news:OuOS2RD2GHA.3476@xxxxxxxxxxxxxxxxxxxxxxx
What are you using to perform the search?
If via ADO, you'd do something like this (VB Script):
set oRootDse=getObject("LDAP://RootDSE")
set oConn=createObject("ADODB.Connection")
set oComm=createObject("ADODB.Command")
oConn.provider="ADsDSOObject"
oConn.open"Active Directory Provider"
oComm.activeConnection=oConn
sADsPath= "<LDAP://"&oRootDse.get("defaultNamingContext")&">;"
sFilter = "(&(objectCategory=person)(objectClass=user)(pager=123321));"
sAttrs = "ADsPath,sAMAccountName,cn,distnguishedName;"
sScope = "SubTree"
sQuery = sADsPath & sFilter & sAttrs & sScope
oComm.commandText = sQuery
oComm.properties("Page Size") = 100
oComm.properties("Size Limit") = 10000
oComm.properties("Cache Results") = false
set oRs=oComm.execute
if(isNull(oRs))then
' nothing came back
else
if(not oRs.eOF)then
' whatever
end if
end if
If using LDP, you simply provide the base DN and the query and ensure
subtree is seleced.
If using ADFIND, you run:
adfind -default -f
"&(objectCategory=person)(objectClass=user)(pager=123321)" samaccountname
cn
--
Paul Williams
Microsoft MVP - Windows Server - Directory Services
http://www.msresource.net | http://forums.msresource.net
.
- Follow-Ups:
- Re: LDAP query for the entire domain
- From: Joe Richards [MVP]
- Re: LDAP query for the entire domain
- References:
- LDAP query for the entire domain
- From: Nuevo
- Re: LDAP query for the entire domain
- From: Brian Desmond [MVP]
- Re: LDAP query for the entire domain
- From: Nuevo
- Re: LDAP query for the entire domain
- From: Paul Williams [MVP]
- LDAP query for the entire domain
- Prev by Date: Re: Moving servers between sites
- Next by Date: Re: Auditing changes in AD objects?
- Previous by thread: Re: LDAP query for the entire domain
- Next by thread: Re: LDAP query for the entire domain
- Index(es):
Relevant Pages
|