Howto: Get Free/Busy Information with WebDAV/HTTP

CDO 1.21, CDOEX, etc can get Free/Busy information, however WebDAV cannot directly. You may use a GET against OWA to get this information. A GET against an OWA URL is really not a WebDAV call… it’s really just plain HTTP GET call – you just need to be sure that the URL is correctly formatted. Most OWA URLS being called in this manor are not supported, however this is one of the few exceptions.

Here are some things to be aware of:

· Free/Busy information is stored in the public store under the NON_IPM_SUBTREE folder related for the user.

· Published Free/Busy information can range between 2 and 36 months.

· Outlook will publish this information based-upon its settings – this is most often set to 15 or 45 minutes; the default varies between versions of Outlook. MADFB will publish Free/Busy information for OWA – about every 15 minutes.

· MADFB runs under the System Attendant process.

· Tentative appointments do not create Schedule+ Free Busy Messages in the Schedule+ Free Busy Folder (See kb 232380).

· The outlook switch /cleanfreebusy can be used to reset free/busy information. 

· If you get a 404 error, be sure that Free/Busy information has been published.

The OWA call is in this format (no line breaks):

http: // {server} /public/?cmd=freebusy & start= {ISO8601 start time} &end= {ISO8601 end time} &interval= {interval block in minutes} &u= {SMTP address of organizer/attendee} [&u=user2&u=user3.]

In code, it might look like this:

sHREF="https://myexserver/public/?Cmd=freebusy&start=2005-03-17T00:00:00-07:00&end=2005-03-19T00:00:00-07:00&interval=10&u=SMTP:Administrator\@mydomain.extest.microsoft.com

Here is a sample from the SDK:

https://msdn.microsoft.com/library/en-us/wss/wss/_esdk_checking_free_busy_status_http.asp

Checking Free/Busy Status (HTTP):

https://msdn.microsoft.com/library/default.asp?url=/library/en-us/e2k3/e2k3/_esdk_checking_free_busy_status_http.asp

Checking Free/Busy Status (CDO)

https://msdn.microsoft.com/library/en-us/wss/wss/_cdo_checking_free_busy_status.asp?frame=true

There is one other way to get this information with WebDAV, although it will take some work. You can do a search on a person's calendar to determine if they will be free or busy.... The problem with this is that the code will need to log-on to the person's mailbox - this will require that the code is running under a user with permission to the mailbox.

Processing time will also be a factor when doing this for many users. Here are the steps:

1) Use a WebDAV SEARCH on the person’s appointments between two dates.

2) Parse and convert this information into a useful format by your application.

 

Now, let’s move on to some samples…

 

VBS - GET FREE/BUSY (OWA Call)

In order to read Free/Busy information, a GET needs to be done against the public folder for the user’s Mailbox. This request will be processed by OWA. It’s important to have the URL corrected, so be careful with the date formatting and SMTP address. If you’re wondering why the public folder is being accessed, it’s because that’s where it is stored – not on the mailbox.

VBS - GET FREE/BUSY (OWA Call)

dim sHREF

dim sUserName

dim sPassword

dim sResponse

Dim HttpWebRequest

 

sHREF="https://myexserver/public/?Cmd=freebusy&start=2005-03-17T00:00:00-07:00&end=2005-03-19T00:00:00-07:00&interval=10&u=SMTP:Administrator\@mydomain.extest.microsoft.com" ' TODO: change

 

sUserName = "Administrator" ' TODO: change

sPassword = "test" ' TODO: change

set HttpWebRequest = CreateObject("microsoft.xmlhttp")

 

HttpWebRequest.Open "GET", sHREF , False, sUserName, sPassword

HttpWebRequest.Send

sResponse = HttpWebRequest.ResponseText ' Returns as text

Set HttpWebRequest = Nothing

wscript.echo sResponse

VB.NET - GET FREE/BUSY (OWA Call)

The .NET way is similar; however you need to be sure to set these headers:

HttpWRequest.Headers.Set("Pragma", "no-cache")

HttpWRequest.KeepAlive = True

HttpWRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1)"