Microsoft KB Archive/246567: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "&" to "&")
m (Text replacement - """ to """)
 
Line 84: Line 84:


The following is a script that works properly when you do a single server query:
The following is a script that works properly when you do a single server query:
<pre class="codesample">srvname = &quot;myserver&quot;
<pre class="codesample">srvname = "myserver"
userDN = &quot;LDAP://&quot; & srvname  
userDN = "LDAP://" & srvname  
    
    
Set ADOConn = CreateObject(&quot;ADODB.Connection&quot;)
Set ADOConn = CreateObject("ADODB.Connection")
Set adoCom2 = CreateObject(&quot;ADODB.Command&quot;)
Set adoCom2 = CreateObject("ADODB.Command")
ADOConn.Provider = &quot;ADSDSOObject&quot;
ADOConn.Provider = "ADSDSOObject"
ADOConn.Open &quot;Active Directory Provider&quot;
ADOConn.Open "Active Directory Provider"
      
      
Set adoCom2.ActiveConnection = ADOConn
Set adoCom2.ActiveConnection = ADOConn
adoCom2.CommandText = &quot;<&quot; & userDN & &quot;>;(home-mdb=*);cn;subtree&quot;
adoCom2.CommandText = "<" & userDN & ">;(home-mdb=*);cn;subtree"
adoCom2.Properties(&quot;Page Size&quot;) = 16
adoCom2.Properties("Page Size") = 16
adoCom2.Properties(&quot;Timeout&quot;) = 1  
adoCom2.Properties("Timeout") = 1  
Set RS2 = adoCom2.Execute
Set RS2 = adoCom2.Execute
If ADOConn.Errors.Count > 0 Then
If ADOConn.Errors.Count > 0 Then
   For Each i In ADOConn.Errors
   For Each i In ADOConn.Errors
     MsgBox &quot;Error: &quot; & i.Description
     MsgBox "Error: " & i.Description
   Next
   Next
End If
End If


MsgBox &quot;Recipients :&quot; & RS2.RecordCount
MsgBox "Recipients :" & RS2.RecordCount
    
    
Set adoCom2 = Nothing
Set adoCom2 = Nothing
Line 110: Line 110:
                 </pre>
                 </pre>
The following is an example of a script that fails:
The following is an example of a script that fails:
<pre class="codesample">srvname = &quot;myserver&quot;
<pre class="codesample">srvname = "myserver"
userDN = &quot;LDAP://&quot; & srvname  
userDN = "LDAP://" & srvname  
      
      
Set ADOConn = CreateObject(&quot;ADODB.Connection&quot;)
Set ADOConn = CreateObject("ADODB.Connection")
Set adoCom2 = CreateObject(&quot;ADODB.Command&quot;)
Set adoCom2 = CreateObject("ADODB.Command")
ADOConn.Provider = &quot;ADSDSOObject&quot;
ADOConn.Provider = "ADSDSOObject"
ADOConn.Open &quot;Active Directory Provider&quot;
ADOConn.Open "Active Directory Provider"
      
      
Set adoCom2.ActiveConnection = ADOConn
Set adoCom2.ActiveConnection = ADOConn
adoCom2.CommandText = &quot;<LDAP://MYSERVER>;(home-mdb='cn=Microsoft Private MDB,cn=MYMACHINE,cn=Servers,cn=Configuration,ou=MYDOMAIN,o=Microsoft');cn,adspath;subtree&quot;
adoCom2.CommandText = "<LDAP://MYSERVER>;(home-mdb='cn=Microsoft Private MDB,cn=MYMACHINE,cn=Servers,cn=Configuration,ou=MYDOMAIN,o=Microsoft');cn,adspath;subtree"


adoCom2.Properties(&quot;Page Size&quot;) = 16
adoCom2.Properties("Page Size") = 16
adoCom2.Properties(&quot;Timeout&quot;) = 1  
adoCom2.Properties("Timeout") = 1  
Set RS2 = adoCom2.Execute
Set RS2 = adoCom2.Execute


If ADOConn.Errors.Count > 0 Then
If ADOConn.Errors.Count > 0 Then
   For Each i In ADOConn.Errors
   For Each i In ADOConn.Errors
       MsgBox &quot;Error: &quot; & i.Description
       MsgBox "Error: " & i.Description
   Next
   Next
End If
End If


If RS2.EOF And RS2.BOF Then
If RS2.EOF And RS2.BOF Then
     MsgBox &quot;EOF & BOF true&quot;
     MsgBox "EOF & BOF true"
End If
End If
    
    
MsgBox &quot;Recipients :&quot; & RS2.RecordCount
MsgBox "Recipients :" & RS2.RecordCount
        
        
Set adoCom2 = Nothing
Set adoCom2 = Nothing

Latest revision as of 13:50, 21 July 2020

Knowledge Base


Article ID: 246567

Article Last Modified on 10/26/2006



APPLIES TO

  • Microsoft Exchange Server 5.5 Service Pack 3



This article was previously published under Q246567


SYMPTOMS

Lightweight Directory Access Protocol (LDAP) searches on either the Home-MDB attribute or the Home-MTA attribute are not returned properly in sites containing multiple Exchange Server 5.5 computers. With a paged LDAP search, you can properly return objects when the number of objects is below the LDAP server limit (default is 100). If the number of objects exceeds the limit, the search returns nothing.

CAUSE

In the internals of the directory, when a paged search is performed, the directory first attempts to see if the total number of objects is more than the page size. If not, it just returns the elements and says it is done. If the number is bigger, the directory performs the search again. Unfortunately, the directory attempts to reconvert the filter back to the internal form. For text and numeric based attributes, this is fine as the directory just does no-ops for each value. However, for distinguished names (DNs) and organizational names, the directory attempts to convert the already converted data. The directory corrupts the filter, the second search does not find any objects, and you get zero results.

RESOLUTION

To resolve this problem, obtain the latest service pack for Exchange Server 5.5. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

191014 XGEN: How to Obtain the latest Exchange Server 5.5 Service Pack


STATUS

Microsoft has confirmed that this is a problem in Microsoft Exchange Server version 5.5 SP3. This problem was first corrected in Exchange Server 5.5 Service Pack 4.

MORE INFORMATION

The following is a script that works properly when you do a single server query:

srvname = "myserver"
userDN = "LDAP://" & srvname 
   
Set ADOConn = CreateObject("ADODB.Connection")
Set adoCom2 = CreateObject("ADODB.Command")
ADOConn.Provider = "ADSDSOObject"
ADOConn.Open "Active Directory Provider"
    
Set adoCom2.ActiveConnection = ADOConn
adoCom2.CommandText = "<" & userDN & ">;(home-mdb=*);cn;subtree"
adoCom2.Properties("Page Size") = 16
adoCom2.Properties("Timeout") = 1 
Set RS2 = adoCom2.Execute
If ADOConn.Errors.Count > 0 Then
  For Each i In ADOConn.Errors
     MsgBox "Error: " & i.Description
  Next
End If

MsgBox "Recipients :" & RS2.RecordCount
   
Set adoCom2 = Nothing
Set RS2 = Nothing
Set rs = Nothing
                

The following is an example of a script that fails:

srvname = "myserver"
userDN = "LDAP://" & srvname 
    
Set ADOConn = CreateObject("ADODB.Connection")
Set adoCom2 = CreateObject("ADODB.Command")
ADOConn.Provider = "ADSDSOObject" 
ADOConn.Open "Active Directory Provider"
    
Set adoCom2.ActiveConnection = ADOConn
adoCom2.CommandText = "<LDAP://MYSERVER>;(home-mdb='cn=Microsoft Private MDB,cn=MYMACHINE,cn=Servers,cn=Configuration,ou=MYDOMAIN,o=Microsoft');cn,adspath;subtree"

adoCom2.Properties("Page Size") = 16
adoCom2.Properties("Timeout") = 1 
Set RS2 = adoCom2.Execute

If ADOConn.Errors.Count > 0 Then
   For Each i In ADOConn.Errors
      MsgBox "Error: " & i.Description
   Next
End If

If RS2.EOF And RS2.BOF Then
    MsgBox "EOF & BOF true"
End If
  
MsgBox "Recipients :" & RS2.RecordCount
       
Set adoCom2 = Nothing
Set RS2 = Nothing
Set rs = Nothing
                

Keywords: kbbug kbexchange550presp4fix kbexchange550sp4fix kbfix kbqfe KB246567