Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 855293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:03:14+00:00 2026-05-15T08:03:14+00:00

I am trying to connect to our exchange 2007 server. I have placed lots

  • 0

I am trying to connect to our exchange 2007 server. I have placed lots of exception handling to catch any errors and put them in the application log. Firstly, I have a function which ensures that a user can access the exchange service with the provided credentials:


public bool Logon()
{
    string pwd = /*Get password*/;

    try
    {
        service.Credentials = new WebCredentials(
            username + "@our.domain", pwd);

        service.FindItems(WellKnownFolderName.Outbox, new ItemView(1));
    }
    catch (Exception)
    {
        return false;
    }
    return true;
}

If this function returns false, an entry is placed in the application log reporting that the user failed to login, the process then terminates.

If the function succeeds, then somewhere down the track we call this function; it gets all appointments for the user which are starting in the next 10 minutes:


protected List GetFutureAppointments()
{
    try
    {
        SearchFilter.IsGreaterThanOrEqualTo startTime =
            new SearchFilter.IsGreaterThanOrEqualTo(
                AppointmentSchema.Start, DateTime.Now);

        SearchFilter.IsLessThanOrEqualTo endTime =
                new SearchFilter.IsLessThanOrEqualTo(
                    AppointmentSchema.Start, DateTime.Now.AddMinutes(10));

        SearchFilter filter = 
            new SearchFilter.SearchFilterCollection(LogicalOperator.And,
                new SearchFilter[] { startTime, endTime });

        FindItemsResults results =  
            service.FindItems(
                WellKnownFolderName.Calendar, filter, new ItemView(10));

        return new List(results.Items);
    }
    catch (Exception e)
    {
        Utilities.LogException(e);
        return null;
    }
}

As you can see, the function will catch all exceptions and log them. Showing up in the log is Request failed. The remote server returned an error: (401) Unauthorized. The stack trace points to the service.FindItems() function.

So I’m a little confused and probably don’t know enough about exchange or web services or whatever. The logon function is returning true, but then authorization fails later on. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:03:15+00:00Added an answer on May 15, 2026 at 8:03 am

    It is possible that your credentials give you access to the Outbox but not the the Calendar?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our MS exchange server doesn't use Imap or pop3 protocols, I am trying to
I'm trying to configure Tomcat to connect to an LDAP server on our network,
When I am trying to connect to my SVN repository on some remote server
We are trying to connect our magento installation with a third party stock management
I'm trying to connect to a TFS2008 server through Visual Studio 2008 (Tools\Connect to
We have a bunch of VB6 apps at our company. We are trying to
I am using Paramiko and trying to connect to my SFTP server. Here is
I have an ADO.Net connection using an ODBC data source to connect to our
I'm trying to read a URL within our corporate network. Spesifically the server I'm
I'm trying to connect to our existing subversion repository. It is set up like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.