Jaguir
Jaguir

Reputation: 3690

How do I export all appointment data from Microsoft Exchange?

I am wanting to export a list of all appointments, for every employee, within the last year. The fields I need are appointment name, start time, end time, location, and attendee emails.

I have started exploring EWS. It appears this only allows you to get appoints for one specific user at a time. My company has over 14,000 associates and assuming about 500 appointments each that would end up being over 7 million web calls. Assuming 1 second per call that would take just under 3 months to export. Meow!

I have not ruled out EWS but it looks like that may not meet my needs. I want to export this data on a daily basis to an sql database. Perhaps incremental grabs after the first pass. Does anyone know of alternative ways to get this data?

I am in a windows server environment and have C#, Powershell, and SQL Server at my disposal. Any suggestions are wanted.

Upvotes: 0

Views: 509

Answers (1)

Jaguir
Jaguir

Reputation: 3690

I ended up staying with EWS. I found that after the initial call to FindItems, I can do another call with LoadPropertiesForItems that will return the properties I need for all items in one call. So I can get a list of items and then load all the attendees with a total of two web calls.

var propertySet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject,
    AppointmentSchema.Start, AppointmentSchema.End, AppointmentSchema.Location,
    AppointmentSchema.RequiredAttendees, AppointmentSchema.OptionalAttendees);
var results = service.FindItems(id, searchFilter, view); // first call
service.LoadPropertiesForItems(results, propertySet); // second call

Upvotes: 1

Related Questions