locked
Exception 'more Data is Available' when I filter for lastLogon>=X RRS feed

  • Question

  • User-1218015009 posted

    Hey,

    I've got some Problems when I try to filter all Users that have logged On since a given Time.

    I've set the PageSize to 8 and the sizeLimit to 500. After 1500 Users, I've got to wait some time and then I get 10-15 Users more, bevore the COM-Exception 'More Data is available' is thrown. Is the timeout been hit? And why does it take so long to find the Users?

     
    Dim de As New DirectoryServices.DirectoryEntry("LDAP://DC=xxx,DC=xxx,DC=xxx")
    Dim dom As DirectoryServices.ActiveDirectory.Domain        
    Dim myResultCol As System.DirectoryServices.SearchResultCollection
    Dim mySearcher As System.DirectoryServices.DirectorySearcher = New DirectoryServices.DirectorySearcher(de)
    
    mySearcher.Filter = "(&(lastLogon<=" & Date.Now.ToFileTime & ")(&(c=DE)lastLogon>=127921762767754646))"
    mySearcher.PageSize = 8
    mySearcher.SizeLimit = 500
    myResultCol = mySearcher.FindAll
    For Each SResult As System.DirectoryServices.SearchResult In myResultCol
          Console.WriteLine(SResult.GetDirectoryEntry.Path)
    Next

     

    Thanks and greez

       Karsten

    Tuesday, May 16, 2006 4:45 AM

All replies

  • User1354132231 posted
    Yech.  A page size of 8 is going to incurr a TON of network trips.  The SizeLimit is ignored when using paging as well.  It is an either/or proposition.  Try using a page size of somewhere between 500 to 1000 and your query stands a chance.
    Tuesday, May 16, 2006 4:29 PM
  • User-1218015009 posted

    Thx!

    I've changed the Filter to

    >mySearcher.Filter = "(&(objectCategory=person)(lastLogon>=" & startTime & "))"

    and changed PageSize and SizeLimit. Now it works and I get all User that have Logged on since a given time :)

     

     

    Wednesday, May 17, 2006 3:58 AM