locked
MS lib slow and Novel lib fast on VM for few operations RRS feed

  • Question

  • User-2126618486 posted

    My web application deployed on a VM is doing a few AD operations way too slow. i tried with Windows application on VM and its fast all operations.

    no clue how to fix it. any help will be appreciated 

    Here are operations which are slow:

    Authenticate user : MS Lib 13 sec (2nd time same user auth in less then a sec),  Novel Open source Lib <1sec, Windows app using MS DirectoryServices < 1 sec ... all running on same VM box

    Change password Non admin (non admin means i need to provide current password ) : time taken is comparable with above except i have not tired novel for this case

    Change password admin (admin means i need not to provide current password ) : time taken is comparable with above except i have not tired novel for this case

    When i install and run web site on my box, its working perfectly fine... even if code is DEBUG version.

    One colleague found that DirectoryServices run out of avaiable outbound ports on VMs... not sure how authentic the info is.

    I will post the answer here when i will have one. 

    thanks guys!

     

     

     

     

    Monday, November 10, 2008 5:23 PM

Answers

  • User-2126618486 posted

     Problem resolved.

    I switch from .NET 2.0 to 3.5 ( from invoke methods to DirectoryServices.AccountManagement ) and its working perfectly fine now.

     

    thanks guys

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 11, 2008 6:14 PM

All replies

  • User-2126618486 posted

     here is code

     MS Auth

                    string userDistinguishedName = user.Properties["distinguishedName"].Value.ToString();

                    string domain = "CompanyDomainName"               
                    LogMethodCalls(80);
                    DirectoryEntry userEntry = new DirectoryEntry(string.Format("LDAP://{0}", LdapHostBasePath), domain + @"\" + loginname, pass,
                        AuthenticationTypes.ServerBind | AuthenticationTypes.FastBind | AuthenticationTypes.ReadonlyServer );
                    LogMethodCalls(81);

                    try
                    {
                        object readVal = userEntry.Guid;//binding is not done till you read some value
                        LogMethodCalls(82);

                        return true;
                    }
                    catch
                    {
                        return false;
                    }

     

    Here is Novel LDAP lib code

      bool isConnected = GetConnectionNovel(ServerName, ServerPort, out conn);

                if (!isConnected) return false;

                int ldapVersion = LdapConnection.Ldap_V3;
                try
                {
                    conn.Bind(ldapVersion, usernameDN, password);

    }

    catch (Exception ex)
                {
                    return false;
                }

     

    Monday, November 10, 2008 6:06 PM
  • User-2126618486 posted

     Problem resolved.

    I switch from .NET 2.0 to 3.5 ( from invoke methods to DirectoryServices.AccountManagement ) and its working perfectly fine now.

     

    thanks guys

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 11, 2008 6:14 PM