I posted this in another group as well...but now I am trying my luck
here...
I have followign method which loads users from active directory
private List<StringGetUserLoginsFromAD()
{
List<Stringresults = new List<string>();
DirectorySearcher srch = new DirectorySearcher();
srch.Filter = "(&(objectClass=user)(objectCategory=person))" ;
//srch.SizeLimit = 100000;
SearchResultCollection sResult = srch.FindAll();
if (null != sResult)
for (int i = 0; i < sResult.Count; i++)
if (null != sResult[i].Properties["SAMAccountName"] &&
sResult[i].Properties["SAMAccountName"].Count == 1)
results.Add(sResult[i].Properties["SAMAccountName"]
[0] as String);
return results;
}
But it throws an exception "A device attached to the system is not
functioning. " when it hits sResult.Count.
Any help will be appreciated.
Thanks