when i run my program , searchresult is error , sizelimit or pagesize can't more than 1000
for example i try on sizelimit=5000 and pagesize=5000
Here is the query i tried, when the button clicked
Public Sub getlist2()
Dim objsearch As DirectorySearcher = New DirectorySearcher()
Dim strrootdse As String = objsearch.SearchRoot.Path
Dim searchroot As New DirectoryEntry(strrootdse)
Dim search As New DirectorySearcher(searchroot)
Dim result As SearchResult
Dim resultcol As SearchResultCollection = search.FindAll()
Dim i, y As Integer
search.PageSize = 5000
search.SizeLimit = 5000
search.Filter = "(&(objectClass=user)(objectCategory=person))"
search.PropertiesToLoad.Add("displayName")
search.PropertiesToLoad.Add("sAMAccountName")
search.PropertiesToLoad.Add("company")
search.Sort.Direction = SortDirection.Ascending
search.Sort.PropertyName = "displayName"
i = resultcol.Count
y = 0
For Each result In resultcol
If y < i Then
nvcData.Add(y.ToString, resultcol(y).Properties("displayName")(0) & " - " & resultcol(y).Properties("sAMAccountName")(0) & " - " & resultcol(y).Properties("company")(0))
y = y + 1
End If
Next
End Sub
None
0 Points
1 Post
SearchResult can't more than 1000 on vs2008
Jun 23, 2015 09:34 PM|JohanDK|LINK
Helllo
I need some help
when i run my program , searchresult is error , sizelimit or pagesize can't more than 1000
for example i try on sizelimit=5000 and pagesize=5000
Here is the query i tried, when the button clicked
this is the error captured
All-Star
48490 Points
18070 Posts
Re: SearchResult can't more than 1000 on vs2008
Jun 29, 2015 05:52 AM|PatriceSc|LINK
Hi,
For now you are calling FindAll *before* setting search parameters.
Not directly related but you could use the result variable and both i and y seems useless...
All-Star
35149 Points
9075 Posts
Re: SearchResult can't more than 1000 on vs2008
Sep 03, 2015 06:06 AM|smirnov|LINK
This is a limit of server configuration and has nothing to do with VS2008.
Please read http://forums.asp.net/t/1309400.aspx and other similar threads on this forum.