none
C# application - Virtual View List with DirectoryVirtualListView - "The server does not support the requested critical extension" RRS feed

  • Question

  •   Hi,

    C# application is implementing Virtual View List with DirectoryVirtualListView on AD/ windows 2008 R2. With following piece of code:

    public class DirectoryItem 
        {
           public string DislayName { get; set; }
           public string CN { get; set; }
           public String FirstName { get ; set;}
           public String LastName { get; set; }
        }
    public class LDAPSearcher
        {
            string adsPath = "LDAP://dc=capulet,dc=com";
            string userName = "capulet\\administrator";
            string password = "1111";
            int offset = 5;
           public  int Total = 0;
            DirectoryEntry searchRoot=null;
            public LDAPSearcher()
            {
                 searchRoot = new DirectoryEntry(
        adsPath,
        userName,
        password,
        AuthenticationTypes.Secure
        );
            }
            public LDAPSearcher(string adsPath, string userName, string password)
            {
                this.adsPath = adsPath;
                this.userName = userName;
                this.password = password;
                 searchRoot = new DirectoryEntry(
                adsPath,
                userName,
                password,
                AuthenticationTypes.Secure
                );
            }
            public List<DirectoryItem> FindVLV(int start, int pagesize, string sortexpression, string direction, string query )
            {
                List<DirectoryItem> db = new List<DirectoryItem>();
                using (DirectorySearcher ds = new DirectorySearcher(searchRoot, query))
                {
                    ds.Sort = new SortOption(
                sortexpression,
                SortDirection.Descending
                );
                    ds.VirtualListView = new DirectoryVirtualListView(0, pagesize-1, start+1 );
                    ds.PropertiesToLoad.Add("DisplayName");
                    ds.PropertiesToLoad.Add("CN");
                    using (SearchResultCollection src = ds.FindAll())
                    {
                        //Console.WriteLine("Found {0}", src.Count);
                        foreach (SearchResult sr in src)
                        {
                            DirectoryItem item = new DirectoryItem();
                            item.CN = sr.Properties["CN"][0].ToString();
                            item.DislayName = sr.Properties["DisplayName"][0].ToString();
                            db.Add(item);
                        }
                    }
                    Total = ds.VirtualListView.ApproximateTotal;   
                }
                
                return db;
            }
        }

    Initially it giving following error:

    “The server does not support the requested critical extension.”

    So I did some googling and did following steps:

    1. applied kb977180-v2 http://support.microsoft.com/kb/977180   , restart windows           2. Added key  HKLM\System\CurrentControlSet\Services\NTDS\Parameters

     Add String value “DSA Heuristics” ,Set the value to 000000000001,restart windows

    So problem solved when LDAP Search result total count is few thousands. (Say 25 of 4000 objects fetched)

    But when objects number exceed to 4000, then I start getting same error again as:

    “The server does not support the requested critical extension.”

    So I changed most LDAP default query parameters to high values as  say

                    MaxTempTableSize=300000   ,  restart windows

            (  Reference: http://support.microsoft.com/kb/2009267 )

    So things got better so now search was working till 71,000 records (say 25 of 71,000)

    But still when I search records more then 100,000 (say 25 of 100,000)

    I still gets error as:

    The server does not support the requested critical extension.

    Note here that I have seen url:

    http://social.technet.microsoft.com/Forums/en-US/winserverDS/thread/183a8f2c-0cf7-4081-9110-4cf41b91dcbf/

    I don’t have problem of “The problem is that the “modifyTimeStamp” is getting changed to “whenChanged” before the search is executed. ” because I am not searching on these fields.

    So  the problem only occurs at high volume data more then 71,000 ( say 25 of 100,000).  Till 71,000 that  is( say 25 of 71,000) , it is working fine.

    Any suggestions/directions to solve it for High volume data (say 25 of 100,000)?


    CyberBug


    • Edited by Cy63r Monday, March 19, 2012 1:23 PM explained more
    Monday, March 19, 2012 1:19 PM

Answers

  • hi,

    LDAP limitations is hardcoded and we can only tune it from editing LDAP policy. For performance concerns, the maxium limits of MaxTempTableSize is 100,000. If you like you can raise the MaxTempTableSize to a lower value and test your query again.

    While a query is processed, the dblayer may try to create a temporary database table to sort and select intermediate results from. The MaxTempTableSize limit controls how large this temporary database table can be. If the temporary database table would contain more objects than the value for MaxTempTableSize , the dblayer performs a much less efficient parsing of the complete DS database and of all the objects in the DS database.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, March 20, 2012 1:18 PM

All replies

  • Hello,

    I think that will be better to ask them here: http://social.msdn.microsoft.com/Forums/en-US/categories



    This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.   

    Microsoft Student Partner 2010 / 2011
    Microsoft Certified Professional
    Microsoft Certified Systems Administrator: Security
    Microsoft Certified Systems Engineer: Security
    Microsoft Certified Technology Specialist: Windows Server 2008 Active Directory, Configuration
    Microsoft Certified Technology Specialist: Windows Server 2008 Network Infrastructure, Configuration
    Microsoft Certified Technology Specialist: Windows Server 2008 Applications Infrastructure, Configuration
    Microsoft Certified Technology Specialist: Windows 7, Configuring
    Microsoft Certified Technology Specialist: Designing and Providing Volume Licensing Solutions to Large Organizations
    Microsoft Certified IT Professional: Enterprise Administrator
    Microsoft Certified IT Professional: Server Administrator
    Microsoft Certified Trainer

    Monday, March 19, 2012 2:47 PM

  • I think it is more suitable to programming forum.

    http://social.technet.microsoft.com/Forums/en-us/project2010custprog/threads

    Hope this helps

    Best Regards,

    Sandesh Dubey.

    MCSE|MCSA:Messaging|MCTS|MCITP:Enterprise Adminitrator | My Blog

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    Monday, March 19, 2012 6:26 PM
  • Thanks AWinish and Sandesh for quick reply.

    I belief that there is no forum specialised for AD - DirectoryService programing. Most the questions related to AD-Directory Service Programmming are posted in "CSharp General" category.

    Actually my query lies at border of programming and administration of AD-Active directory. So AD administrators are important to solve this problem. As code works in normal cases.

    LDAP search with  Virtual View List is working  when " ldap query return : 71,000 and paging is done in 25 records as page size". It only fails when Virtual View List is used for returning more then 100,000 (with page size:  25) .

    It is more related to configuration/administration of AD for case of Virtual View List.

    Thanks.


    CyberBug

    Tuesday, March 20, 2012 4:51 AM
  • Hi CyberBug,

    Thank you for your post.

    Maybe 71,000 is the limited value of MaxTempTableSize.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Regards,


    Rick Tan

    TechNet Community Support

    Tuesday, March 20, 2012 7:02 AM
    Moderator
  • hi,

    LDAP limitations is hardcoded and we can only tune it from editing LDAP policy. For performance concerns, the maxium limits of MaxTempTableSize is 100,000. If you like you can raise the MaxTempTableSize to a lower value and test your query again.

    While a query is processed, the dblayer may try to create a temporary database table to sort and select intermediate results from. The MaxTempTableSize limit controls how large this temporary database table can be. If the temporary database table would contain more objects than the value for MaxTempTableSize , the dblayer performs a much less efficient parsing of the complete DS database and of all the objects in the DS database.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, March 20, 2012 1:18 PM
  • Thanks Brian.

    Thing gets solved with ideas..!!!


    CyberBug

    Friday, April 6, 2012 1:21 PM
  • Have you tried the VLV C# code found at http://msdn.microsoft.com/en-us/library/bb332056.aspx?  Try that in your environment and see if it works.

    Also, you can raise the MaxTempTableSize, however 2008 and 2008 R2 have a hardcoded limitation of 10,000. http://support.microsoft.com/kb/2009267

    -Brian


    BrianY MCT, MCLC

    Friday, April 6, 2012 4:40 PM