Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


View Multiple Calendars with WebDAV

Posted on 2011-10-04
Medium Priority
Last Modified: 2013-12-06
I am successfully displaying calendar appointments for a specific Exchange account. I do this by using WebDav and passing a request string like the following:

"<?xml version=\"1.0\"?><g:searchrequest xmlns:g=\"DAV:\"><g:sql>SELECT \"urn:schemas:calendar:location\", \"urn:schemas:httpmail:subject\", \"urn:schemas:calendar:dtstart\", \"urn:schemas:calendar:dtend\", \"urn:schemas:calendar:busystatus\", \"urn:schemas:calendar:instancetype\" FROM Scope('SHALLOW TRAVERSAL OF \"https://www.mydomain.com/Exchange/Allen/Calendar\"') WHERE NOT \"urn:schemas:calendar:instancetype\" = 1 AND \"DAV:contentclass\" = 'urn:content-classes:appointment' AND \"urn:schemas:calendar:dtstart\" > '2011/10/04 00:00:00' AND \"urn:schemas:calendar:dtend\" &lt; '2011/10/05 00:00:00' ORDER BY \"urn:schemas:calendar:dtstart\" ASC</g:sql></g:searchrequest>"

Note that the above string has a SELECT statement with a FROM clause, similar to most database queries. The FROM clause references the calendar for the Exchange account Allen ("https://www.mydomain.com/Exchange/Allen/Calendar\"). This (among other lines of code not included here) successfully retrieves and displays Allen's appointments.

What I want to do is retrieve and display the appointments for 2 or more calendars at the same time. So my question is, how do I chain 2 or more requests in the above string?

From a standard database query standpoint, maybe a JOIN clause can be added in order to include another source (calendar). Maybe the above SELECT could have Allen's appointments (FROM "https://www.mydomain.com/Exchange/Allen/Calendar\") and then include Bob's appointments with something like JOIN "https://www.mydomain.com/Exchange/Bob/Calendar\". But JOINs genearlly imply that there is some relation between the 2 sources. But Allen and Bob's calendar data are completely independent appointments, and not related in any way.

What may be more appropriate is a UNION statement that would include the SELECTed data from Allen's calendar along with (UNION) the SELECTed data from Bob's calendar.

The bottom line is that I can't figure out how to modify the above string to request calendar data from multiple sources. Does anyone know how to make this work?

Question by:brian_appliedcpu
LVL 31

Accepted Solution

LeeDerbyshire earned 2000 total points
ID: 36949169
Sadly, you can't do that with Exchange's WebDAV SQL.  It is only a tiny subset of ANSI SQL.  There is a list of unsupported SQL commands here:

You'll need to get the data from both calendars separately, and then do the hard work in code.

Author Closing Comment

ID: 37039685

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have come across a situation where you need to find some EDB mailbox recovery techniques, then here you will find the same. In this article, we will take you through three techniques using which you will be able to perform EDB recovery. You …
Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question