LDAP search in subdomains
From: Dirk Bartenschlager (dbart_at_tarsom.com)
Date: 02/24/04
- Next message: Michael Holzemer: "Re: Change from static IP address to DHCP"
- Previous message: Viatcheslav V. Vassiliev: "Re: How to determine Internet Explorer LANGUAGE and VERSION?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 24 Feb 2004 16:14:29 +0100
Hi,
I found a script to search for a userid in the AD. I modified it:
-----------------------------------------------------------------------
Set Connection = CreateObject("ADODB.Connection")
Connection.Provider = "ADsDSOObject"
Connection.Open "Active Directory Provider"
Set Command = CreateObject("ADODB.Command")
Command.ActiveConnection = Connection
strName = "UserName"
ADsPath = "dc=eu,dc=intra-global,dc=net" 'here I want to search eu, au,
am, ee domains
sFilter = "(&(objectCategory=person)(objectClass=user)(name=" & strName &
"))"
sAttribsToReturn = "name,distinguishedName"
' Tiefe der Suchabfrage
sDepth = "subTree"
query = "<LDAP://" & ADsPath & ">;" & sFilter & ";" & sAttribsToReturn & ";"
& sDepth
MsgBox "Abfrage: " & query
Command.CommandText = query
Set rs = Command.Execute
MsgBox rs.RecordCount & " Benutzerkonten gefunden, die """ & strName & """
entsprechen."
MsgBox rs.GetString
----------------------------------------------------------------------------
---- Our rootdomain is: dc=intra-global,dc=net We have several subdomains: dc=eu or dc=am or dc=ee or dc=au My userid is in the domain eu and if I start the seach for eu it is working. If I start the search for another domain is not working. Then no user is found. I started the script on domain controller with admin rights for each subdomain without success. Any ideas? Thanks in advance Dirk
- Next message: Michael Holzemer: "Re: Change from static IP address to DHCP"
- Previous message: Viatcheslav V. Vassiliev: "Re: How to determine Internet Explorer LANGUAGE and VERSION?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|