I'm doing an ADODB recordset.open() command with an LDAP query to get all the users from my Active Directory.
There are about 2600 users, but I'm only getting back 1000 of them.
I've tried altering the recordset's PageSize and MaxRecords properties with no luck.
Without extraneous stuff, this is what the code looks like (I've made the connection details generic):
ADODB.Connection conn = new ADODB.Connection();
ADODB.Recordset rs = new ADODB.Recordset();
rs.MaxRecords = 10000;
rs.PageSize = 10000;
conn.Open("Active Directory Provider","","",0);
string query = "SELECT cn FROM 'LDAP://OU=User Accounts,OU=TopLevel,DC=domainName,DC=local' where samAccountName = '*'"
rs.Open(query, conn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic, -1);
It's definitely only returning 1000 records, (I've confirmed), and I can access them just fine.
In case it helps, the reason I'm not using DirectorySearcher is because it's so slow in comparison to this.