This documentation is archived and is not being maintained.

Rendering Free-Busy Status to a Web Page with CDOEX

Exchange Server 2003

Rendering Free-Busy Status to a Web Page with CDOEX

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

VBScript

'Rendering free-busy status to a Web page with CDOEx
<!--
'Build Instructions:
'1) Create a folder named "test" under inetpub/wwwroot.
'2) Save the following file in that folder with the mentioned name.
'3)  Make the changes to the below file i.e. Change the UserName, DomainName, ServerName, strStartTime, strEndTime, iInterval variable to reflect your mailbox, domain and search criteria.
'4) Save the file.
'5) open internet service manager and browse to the "test"  folder
'6) right click and go to properties
'7) go to the "Directory Security" tab.
'8) Click on "Edit" button next to the "handshake" icon
'9) Uncheck "Anonymous Access"
'10) Uncheck "Anonymous access",  check the "Basic authentication", "Digest authentication", "Integrated Windows authentication"
'11) click ok
'12) click ok
'13) Load the asp in the browser.
 -->

<!--
<%@ Language=VBscript%>
<%
    Sub PrintStatus(strStatus)
   Select Case strStatus
   Case "0"   'Free
      Response.Write "<TD>Free</TD></TR>"
   Case "1"   'Tentative
      Response.Write "<TD>Tentative</TD></TR>"
   Case "2"   'Busy
      Response.Write "<TD>Busy</TD></TR>"
   Case "3"   'Out Of Office

      Response.Write "<TD>Out Of Office</TD></TR>"
   End Select
    End Sub

    UserName = "username"
    DomainName = "domain.fourthcoffee.com"
    ServerName = "servername"
    strStartTime = #1/20/2000 7:00:00 AM#
    strEndTime = #1/20/2000 11:00:00 AM#
    iInterval = 30

    Set iAddr = createobject("CDO.Addressee")
    iAddr.EmailAddress = UserName & "@" & DomainName
    iAddr.CheckName ("LDAP://" & ServerName)

    strFreebusy = iAddr.GetFreeBusy(strStartTime, strEndTime, iInterval)

    Response.Write "<Table Border =1>"
    For i = 1 To Len(strFreebusy)
   If i = 1 Then
      Response.Write "<TR><TD>Start Time</TD><TD>" & strStartTime & " ~ </TD>"
   Elseif i = len(strFreebusy) Then
      Response.Write "<TR><TD>End Time</TD><TD>" & strEndTime & " ~ </TD>"
   Else
      Response.Write "<TR><TD>.</TD><TD> + " & iInterval & " min ~ </TD>"
   End If
   Call PrintStatus(Mid(strFreebusy, i, 1))
    Next
    Response.Write "</TABLE>"
    Set iAddr = Nothing
%>
-->

Show: