views:

441

answers:

1

In EWS Managed API is it easy to create an appointment for a specific user:

ExchangeService service = new ExchangeService();
service.Credentials = new NetowrkCredentials ( "administrator", "password", "domain" );
service.AutodiscoverUrl(emailAddress);

Appointment appointment = new Appointment(service);
appointment.Subject = "Testing";
appointment.Start = DateTime.Now;
appointment.End = appointment.Start.AddHours(1);
appointment.Save();

This will create a appointment for the administrator. But say I wanted to actually create an appointment for another user (not add that user as an attendee to me appointment). It this possible via the EWS Managed API?

A: 

I figured it out from this article: http://msdn.microsoft.com/en-us/library/dd633680(EXCHG.80).aspx

You should use the service.ImpersonatedUserId attribute.

Zenox