S
Sehboo
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<String> GetUserLoginsFromAD()
{
List<String> results = 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.Properties["SAMAccountName"] &&
sResult.Properties["SAMAccountName"].Count == 1)
results.Add(sResult.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
here...
I have followign method which loads users from active directory
private List<String> GetUserLoginsFromAD()
{
List<String> results = 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.Properties["SAMAccountName"] &&
sResult.Properties["SAMAccountName"].Count == 1)
results.Add(sResult.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