title: Add Appointment to Exchange Calendar from ASP.NET MVC Intranet Application
body: <p>I have got an ASP.NET MVC 4 Intranet Application.</p>
  
  <p>The application uses the windows authentication for authenticating users.
  I can get the Username with User.Identity.Name. This contain the domain name and username (MyDomain\Username).</p>
  
  <p>I now want to add an appointment to the users calender via the Exchange Web Service API.</p>
  
  <p>I can do this like the following:</p>
  
  <pre><code>var service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
          service.Credentials = new WebCredentials(Settings.MyAccount, Settings.MyPassword);
          service.Url = new Uri(Settings.ExchangeServer);
  
  var appointment = new Microsoft.Exchange.WebServices.Data.Appointment(service);
  appointment.Subject = setAppointmentDto.Title;
  appointment.Body = setAppointmentDto.Message;
  appointment.Location = setAppointmentDto.Location;
  
   ...
  
  appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
  </code></pre>
  
  <p>This adds an appointment for the user specified in the credentials.</p>
  
  <p>I do not have the password for the currently logged in user.
  Since I am using Windows Authentication (Active Directory Account), is there a way to somehow use this authentication information to use the Exchange Web service with the account of the user who uses the web application?
  Because of security it is not possible to retrieve the user's password from Active Directory.</p>
  
  <p>Is there another way of doing this?
  Is it possible to create an appointment for another user as the user who uses the service?</p>
  
  <p>Greetings</p>
  
  <p>Alexander</p>