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 6716573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:45:00+00:00 2026-05-26T08:45:00+00:00

In our organization we are trying to use EWS Managed API to access mailboxes

  • 0

In our organization we are trying to use EWS Managed API to access mailboxes from a custom UI client on Exchange 2010. We have a .NET 4.0 WCF service running on IIS 7.5 calling the EWS methods on behalf of the UI client. Client and WCF service communicate over https, so does the WCF service and EWS. We now want to create service accounts (basically AD accounts with impersonation rights on certain email inboxes) and run the WCF service under these service accounts. However, when I run the WCF service under a particular AD user in IIS (Anonymous authentication enabled with Anonymous user identity set to the specific AD user), EWS throws a 401 Unauthorized exception. Upon examining the ExchangeService object, the Credentials object is null. If I hardcode the credentials, the service can access EWS. Below is the code that I am using to create the ExchangeService object.

var service = new ExchangeService(ExchangeVersion.Exchange2010)
 {
     Url = new Uri(ConfigurationManager.AppSettings["EWSUrl"]),
     // If I uncomment the below line, the service can access EWS. However, I want the user under which the service is running to access EWS.
     //Credentials = new NetworkCredential("ImpersonatingUser", "secretPwd", "TESTDOMAIN"),
     ImpersonatedUserId = new ImpersonatedUserId { Id = emailAddress, IdType = ConnectingIdType.SmtpAddress },
 };

I read somewhere that the System.ServiceModel.ServiceSecurityContext.Current.WindowsIdentity object will have the current user under which the service is running. However, the System.ServiceModel.ServiceSecurityContext.Current context is null in my case.

How do I get the service account’s credentials (without hardcoding it in the code) and pass it to EWS? Please let me know if you need more details.

Edit: In IIS 7.5, I have created a separate app pool running under the impersonating AD user’s identity, and configured my WCF service to run in this app pool. Still can’t get the service credentials.

Thanks in advance.

  • 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-26T08:45:01+00:00Added an answer on May 26, 2026 at 8:45 am

    Unless your WebService runs on the Exchange box, you’ll need to configure Kerberos. NTLM does not allow credential delegation.

    Another option is to switch to Basic authentication secured with SSL. But this means to loose single sign on in your client application.

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

Sidebar

Related Questions

Our organization recently got TFS 2008 set up ready for our use. I have
Our organization has a central solution for forms authentication. I am trying to implement
Our organization's software is compiled for the .NET 3.5 Framework. We have some customers
We have a config spec that we use for our builds that we encourage
We have just gotten TFS 2010 up and running. We will be migrating our
Our organization's custom build tools write out a lot of intermediate data, and I'd
For our organization we need to have users watch a .mov file and not
I'm trying to convince my organization to start running unit tests on our C++
I am trying to set up my organization's source control architecture for our Sage
In our organization we have 6 teams: 3 project teams who provide software to

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.