none
EWS managed API: Diagnostic code sample needed when autodiscover fails RRS feed

  • Question

  • In a perfect world, we build a our tools and they will work perfectly everywhere as long as the client enters the correct user account and password information.

    However, autodiscover functionality on Exchange often is not configured correctly on many client sites and our tool does not work.

    I would love to get a piece of code that does some basic checks and can be used as a starting point for the administrator on the Exchange site to correct the problem and configure their server correctly so my tool works.

    Anyone done this already and willing to share?

     

    John


    Thanks, John
    Monday, December 6, 2010 5:08 PM

Answers

  • I would point the admin towards https://www.testexchangeconnectivity.com/ this is the definative tool most good admins use to test autodiscover. You might however want to try to make your tool a little more robust eg even though some sites might not have there DNS server configured correctly the SCP in Active Directory will generally work. As long as your code can query AD you can make use of this eg

              String ScpUrlGuidString = "77378F46-2C66-4aa9-A6A6-3E7A48B19596";
              String ScpPtrGuidString = "67661d7F-8FC4-4fa7-BFAC-E1D7794C1F68";
              DirectoryEntry rdRootDSE = new DirectoryEntry("LDAP://RootDSE");
              DirectoryEntry cfConfigPartition = new DirectoryEntry("LDAP://" + rdRootDSE.Properties["configurationnamingcontext"].Value);
              DirectorySearcher cfConfigPartitionSearch = new DirectorySearcher(cfConfigPartition);
              cfConfigPartitionSearch.Filter = "(&(objectClass=serviceConnectionPoint)(|(keywords=" + ScpPtrGuidString + ")(keywords=" + ScpUrlGuidString + ")))";
              cfConfigPartitionSearch.SearchScope = SearchScope.Subtree;
              SearchResult srSearchResult = cfConfigPartitionSearch.FindOne();
              if (srSearchResult != null)
              {
                DirectoryEntry scpServiceConnectionPoint = srSearchResult.GetDirectoryEntry();
                URL = scpServiceConnectionPoint.Properties["serviceBindingInformation"].Value.ToString();
              }
              else
              {
                throw new Exception("No SCP found");
              }
    
    Cheers
    Glen
    • Marked as answer by John. _ Tuesday, December 7, 2010 12:11 PM
    Tuesday, December 7, 2010 2:19 AM

All replies

  • John,

     

    Start Microsoft Outlook you can see the small Outlook icon in lower right corner of your (Windows) PC. Press the Control key together with a right mouse click, select ‘Test E-mail AutoConfiguration’option.

     

    Fill in your e-mail address and password, and to check the Autodiscover functionality only deselect the “Use Guessmart” and “Secure Guessmart Authentication”. When you click Test the Outlook client will check the full Autodiscover functionality (be aware that this can take up to 60 seconds) and the results will be shown on the Results tab, this will vary based on your configuration.


    Monday, December 6, 2010 9:39 PM
  • Thank you. That is a good suggestion and alternative if no code sample is available.
    Thanks, John
    Monday, December 6, 2010 10:32 PM
  • I would point the admin towards https://www.testexchangeconnectivity.com/ this is the definative tool most good admins use to test autodiscover. You might however want to try to make your tool a little more robust eg even though some sites might not have there DNS server configured correctly the SCP in Active Directory will generally work. As long as your code can query AD you can make use of this eg

              String ScpUrlGuidString = "77378F46-2C66-4aa9-A6A6-3E7A48B19596";
              String ScpPtrGuidString = "67661d7F-8FC4-4fa7-BFAC-E1D7794C1F68";
              DirectoryEntry rdRootDSE = new DirectoryEntry("LDAP://RootDSE");
              DirectoryEntry cfConfigPartition = new DirectoryEntry("LDAP://" + rdRootDSE.Properties["configurationnamingcontext"].Value);
              DirectorySearcher cfConfigPartitionSearch = new DirectorySearcher(cfConfigPartition);
              cfConfigPartitionSearch.Filter = "(&(objectClass=serviceConnectionPoint)(|(keywords=" + ScpPtrGuidString + ")(keywords=" + ScpUrlGuidString + ")))";
              cfConfigPartitionSearch.SearchScope = SearchScope.Subtree;
              SearchResult srSearchResult = cfConfigPartitionSearch.FindOne();
              if (srSearchResult != null)
              {
                DirectoryEntry scpServiceConnectionPoint = srSearchResult.GetDirectoryEntry();
                URL = scpServiceConnectionPoint.Properties["serviceBindingInformation"].Value.ToString();
              }
              else
              {
                throw new Exception("No SCP found");
              }
    
    Cheers
    Glen
    • Marked as answer by John. _ Tuesday, December 7, 2010 12:11 PM
    Tuesday, December 7, 2010 2:19 AM
  • John,

    Please check following links

     

    Code:

    http://msdn.microsoft.com/en-us/library/gg274406%28EXCHG.80%29.aspx

    http://msdn.microsoft.com/en-us/library/gg274410%28EXCHG.80%29.aspx

    http://msdn.microsoft.com/en-us/library/dd637749%28EXCHG.80%29.aspx

    http://omegacoder.com/?p=454

    http://stackoverflow.com/questions/3890986/how-to-use-microsoft-exchange-webservices

    Others:

    http://www.msexchange.org/articles_tutorials/exchange-server-2010/management-administration/exchange-autodiscover.html

    Tuesday, December 7, 2010 2:50 AM
  • thanks guys!
    Thanks, John
    Tuesday, December 7, 2010 12:12 PM