473,324 Members | 2,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Active directory and LDAP problem

kenobewan
4,871 Expert 4TB
Hi there,

having a problem getting a complete users list out of AD. Code used in component:

oRoot = New DirectoryEntry("LDAP://LDAPServer/DC=domain,DC=com")
oSearcher = New DirectorySearcher(oRoot)

Dim strFilter As String
strFilter += "(&"
strFilter += "(objectCategory=CN=Person,CN=Schema,CN=Configurat ion,DC=rayaust,DC=au,DC=ray,DC=com)"
strFilter += "(samAccountName=*)"
strFilter += "(mail=*)"
strFilter += "(|"
strFilter += "(sn=*)"
strFilter += "(GivenName=*)"
strFilter += ")"
strFilter += ")"

oSearcher.Filter = (strFilter)
oResults = oSearcher.FindAll

Then in the VB.NET of the page:

Me.DsOwnerAD1 = comAD.GetAllUsers()
Dim dv As New DataView(Me.DsOwnerAD1.tblOwnerDetails())
Dim Row As dsOwnerAD.tblOwnerDetailsRow
dv.Sort = "Lastname"
For Each Row In dv.Table.Rows
If Not Row.LastName.ToString = "" Then
Dim Item As String
Dim Item2 As String
Item = Row.LastName.Trim + ", " + Row.FirstName.Trim
Item2 = Row.OwnerAD

Me.lbOwnerADs.Items.Add(New ListItem(Item, Row.FirstName))
End If
Next

Any ideas? I have played with the filter and got slightly different list, but never complete.

Many thanks.
Dec 4 '06 #1
1 1170
kenobewan
4,871 Expert 4TB
Turns out it was the page size that was the key:

[oSearcher.PageSize = 1000]
Dec 5 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Victor Lokhmatov | last post by:
Hello Everyone, My company has asked me to put a company directory on our intranet site and I'm trying to use php to extract the users from our active directory server. I've got everything...
0
by: microsoft | last post by:
Hi People, when I try to modify an active directory user programatically, I receive the following exception: The server is unwilling to process the request Reading the microsoft web site, I...
10
by: huzz | last post by:
I have web application that quaries the Active Directory to get user details.. everything works fine but someday I'll get System.Runtime.InteropServices.COMExection and if I restart the client...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
12
by: JIM.H. | last post by:
Hello, Here is my code that I got from internet and I am assuming this give me e-mail address of the people in the active directory. Private Sub Page_Load(ByVal sender As System.Object, ByVal e...
9
by: Patrick | last post by:
I have an ASP.NET page that searches for someone in the corporate Active Directory. It had been working fine until recently when I changed from Basic Authentication on IIS6 back to Integrated...
0
by: RTT | last post by:
here is my current situation. I develop a program on my computer's localhost. From there i contact Active directory succesfull using a connectionstring like:...
2
by: Jim in Arizona | last post by:
My goal, somehow, is to populate a dropdownlist with all the user names in active directory. I don't even know where to begin, really. I added a reference to System.DirectoryServices so I could...
18
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.