SearchResultCollection count error:cannot obtain value RRS feed

  • Question

  • User991541353 posted

    Hi there,

     I'm trying to return all records from a particular OU. My code is:

    Dim de As DirectoryEntry = New DirectoryEntry(ldapPath, user, pwd, AuthenticationTypes.Secure)

    Dim ds = New DirectorySearcher(de)

    ds.SearchScope = SearchScope.Subtree

    ds.PageSize = 1000

    src = ds.FindAll

    srccount = src.Count

    Yesterday this was working fine and returning all the records I need. Today I get a error: cannot obtain value when I try and watch the src.Count through VS2005 (no other error is generated, no exception is generated when I use a try catch block. I can still query AD by a specific user by specifying a filter in the directorysearcher. Our dev domain allows me to search the full OU but production doesn't. Something has changed on the AD server somewhere.

     Any ideas so I can point my sysadmins in the right direction?



    Wednesday, June 6, 2007 11:39 AM

All replies

  • User991541353 posted

    This seems to be working ok again today. Bizarre. I'll keep an eye on it and come back if it fails again.

    Thursday, June 7, 2007 3:20 AM