Recordset size is always 100
Hello all,
I am trying to retrieve all users of our domain using ADSI.
Although there are more then 1150 users in our Active Directory,
the output is always 1000 records.
Can anyone help me?
Here is the code :
Thanks in advance.
<%@ Language = VBScript %>
<html>
<head>
<title> ADSI Results Page </title>
</head>
<body background="exptextb.jpg" bgcolor="#FFFFFF" text="#000000">
<h1><center> Results </center></h1>
<%
Dim strSearchBase
strSearchBase = "LDAP://dc=novabank,dc=gr"
'Set a filter for searching
dim strfilter
strfilter = "(&(displayname=" & displayname &"*)" & "(givenname="& givenname &"*)" & "(Title=" &"*))"
'strfilter = "(&(displayname=" & displayname &"*)" & "(givenname="& givenname &"*))"
'Select the Attributes you want to see
Dim strAttribs
strAttribs = "displayName,mail"
'Set the searching scope, We are searching the AD tree from the beggining to the end.
Dim strScope
strScope = "subtree"
'connection to Active Directory and crestion of the first Recordset --Dim strCommandText
strCommandText = "<" & strSearchBase & ">;" _
& strFilter & ";" & strAttribs & ";" & strScope
Dim oConnection
Set oConnection = Server.CreateObject("ADODB.Connection")
Dim oCommand
Set oCommand = Server.CreateObject("ADODB.Command")
oConnection.Provider = "ADsDSOObject"
oConnection.Open "Active Directory Provider"
set oCommand.ActiveConnection = oConnection
oCommand.CommandText = strCommandText
Dim oRecordset
set orecordset = Server.CreateObject("ADODB.Recordset")
oRecordset.maxrecords=1100
Set oRecordset = oCommand.Execute(strCommandText) 'First recordset creation
%>
<center>
<TABLE Border=4 cellspacing=1>
<TR>
<TH>Full Name</th><th>mail</th></tr>
</center>
<%
Response.Write "</tr>"
While Not orecordset.EOF
Response.Write "<tr>"
For Each oField in orecordset.Fields
Response.Write "<td>"
Response.Write ofield.value & " "
Response.Write "</td>"
next
Response.Write "</tr>"
orecordset.MoveNext
Wend
i=orecordset.recordcount
Response.Write "</tr></table>"
response.write( "number of records : " & i)
'******** Clear the Recordsets
oRecordset.Close
Set orecordset = Nothing
Set oconn = Nothing
%>
<BR>
</body>
</html>
|