Привет!
Есть код, который запрашивает в AD данные (например, User'ов)
В нем возвращается не более 2000 строк. Можно это как-нибудь победить?
int st=0;
OleDbConnection Connection = new OleDbConnection("Provider=ADsDSOObject");
try
{
Connection.Open();
Console.WriteLine(DateTime.Now.ToString()+" Connection to Active Directory established successfully.");
}
catch
{
Console.WriteLine(DateTime.Now.ToString()+" Error connection to Active Directory.");
return;
}
string objQuery = "Select pager, samaccountname from 'LDAP://DC=int,DC=cboss,DC=ru' " + "where objectCategory = 'CN=Person,CN=Schema,CN=Configuration,DC=int,DC=cboss,DC=ru'";
OleDbCommand objCommand = new OleDbCommand(objQuery , Connection);
try
{
OleDbDataReader objReader = objCommand.ExecuteReader();
while (objReader.Read())
{
st++;
Console.WriteLine(objReader.GetValue(0).ToString()+" "+objReader.GetValue(1).ToString());
}
objReader.Close();
Connection.Close();
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
Console.WriteLine(st.ToString());
Console.ReadLine();