There is an example of getting FreeBusy from an exchange server from VB.NET. I use this to coordinate calendar invites on an external DMZ for outside vendors to streamline meeting request.

Imports Microsoft.Exchange.WebServices.Data

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim Server As New Microsoft.Exchange.WebServices.Data.ExchangeService(ExchangeVersion.Exchange2010)
        Server.Url = New System.Uri("https://Webmail/EWS/Exchange.asmx")
        GetSuggestedMeetingTimesAndFreeBusyInfo(Server)
    End Sub

    Private Shared Sub GetSuggestedMeetingTimesAndFreeBusyInfo(ByVal service As ExchangeService)
        Dim attendees As List(Of AttendeeInfo) = New List(Of AttendeeInfo)()
        attendees.Add(New AttendeeInfo() With {
            .SmtpAddress = "First@Email.com",
            .AttendeeType = MeetingAttendeeType.Organizer
        })
        attendees.Add(New AttendeeInfo() With {
            .SmtpAddress = "Second@Email.com",
            .AttendeeType = MeetingAttendeeType.Required
        })
        Dim availabilityOptions As AvailabilityOptions = New AvailabilityOptions()
        availabilityOptions.GoodSuggestionThreshold = 49
        availabilityOptions.MaximumNonWorkHoursSuggestionsPerDay = 0
        availabilityOptions.MaximumSuggestionsPerDay = 2
        availabilityOptions.MeetingDuration = 60
        availabilityOptions.MinimumSuggestionQuality = SuggestionQuality.Good
        availabilityOptions.DetailedSuggestionsWindow = New TimeWindow(DateTime.Now.AddDays(1), DateTime.Now.AddDays(7))
        availabilityOptions.RequestedFreeBusyView = FreeBusyViewType.FreeBusy
        Dim results As GetUserAvailabilityResults = service.GetUserAvailability(attendees, availabilityOptions.DetailedSuggestionsWindow, AvailabilityData.FreeBusyAndSuggestions, availabilityOptions)
        Console.WriteLine("Availability for {0} and {1}", attendees(0).SmtpAddress, attendees(1).SmtpAddress)
        Console.WriteLine()

        For Each suggestion As Suggestion In results.Suggestions
            Console.WriteLine("Suggested date: {0}" & vbLf, suggestion.Date.ToShortDateString())
            Console.WriteLine("Suggested meeting times:" & vbLf)

            For Each timeSuggestion As TimeSuggestion In suggestion.TimeSuggestions
                Console.WriteLine(vbTab & "{0} - {1}" & vbLf, timeSuggestion.MeetingTime.ToShortTimeString(), timeSuggestion.MeetingTime.Add(TimeSpan.FromMinutes(availabilityOptions.MeetingDuration)).ToShortTimeString())
            Next
        Next

        Dim i As Integer = 0

        For Each availability As AttendeeAvailability In results.AttendeesAvailability
            Console.WriteLine("Availability information for {0}:" & vbLf, attendees(i).SmtpAddress)

            For Each calEvent As CalendarEvent In availability.CalendarEvents
                Console.WriteLine(vbTab & "Busy from {0} to {1} " & vbLf, calEvent.StartTime.ToString(), calEvent.EndTime.ToString())
            Next

            i += 1
        Next
    End Sub
End Class

Availability for first@email.com and second@email.com

Suggested date: 8/20/2019

Suggested meeting times:

10:00 AM - 11:00 AM

10:30 AM - 11:30 AM

Suggested date: 8/21/2019

Suggested meeting times:

9:00 AM - 10:00 AM

10:30 AM - 11:30 AM

Suggested date: 8/22/2019

Suggested meeting times:

9:00 AM - 10:00 AM

9:30 AM - 10:30 AM

Suggested date: 8/23/2019

Suggested meeting times:

9:00 AM - 10:00 AM

10:30 AM - 11:30 AM

Suggested date: 8/24/2019

Suggested meeting times:

Suggested date: 8/25/2019

Suggested meeting times:

Availability information for first@email.com:

Busy from 8/20/2019 9:00:00 AM to 8/20/2019 10:00:00 AM 

Busy from 8/20/2019 11:45:00 AM to 8/20/2019 1:15:00 PM 

Busy from 8/20/2019 2:30:00 PM to 8/20/2019 3:00:00 PM 

Busy from 8/20/2019 5:00:00 PM to 8/20/2019 6:00:00 PM 

Busy from 8/21/2019 10:00:00 AM to 8/21/2019 10:30:00 AM 

Busy from 8/21/2019 11:00:00 AM to 8/21/2019 12:00:00 PM 

Busy from 8/21/2019 11:45:00 AM to 8/21/2019 1:15:00 PM 

Busy from 8/21/2019 4:30:00 PM to 8/21/2019 5:00:00 PM 

Busy from 8/22/2019 11:45:00 AM to 8/22/2019 1:15:00 PM 

Busy from 8/22/2019 1:30:00 PM to 8/22/2019 5:00:00 PM 

Busy from 8/22/2019 5:00:00 PM to 8/22/2019 6:00:00 PM 

Busy from 8/22/2019 8:00:00 PM to 8/22/2019 9:00:00 PM 

Busy from 8/23/2019 12:00:00 AM to 8/27/2019 6:00:00 PM 

Busy from 8/23/2019 10:00:00 AM to 8/23/2019 10:15:00 AM 

Busy from 8/23/2019 11:45:00 AM to 8/23/2019 1:15:00 PM 

Busy from 8/23/2019 1:30:00 PM to 8/23/2019 5:00:00 PM 

Busy from 8/23/2019 4:30:00 PM to 8/23/2019 4:35:00 PM 

Busy from 8/23/2019 5:00:00 PM to 8/23/2019 6:00:00 PM 

Availability information for second@email.com:

Busy from 8/20/2019 8:00:00 AM to 8/20/2019 9:00:00 AM 

Busy from 8/20/2019 9:00:00 AM to 8/20/2019 10:00:00 AM 

Busy from 8/20/2019 9:00:00 AM to 8/20/2019 10:00:00 AM 

Busy from 8/20/2019 11:45:00 AM to 8/20/2019 1:15:00 PM 

Busy from 8/21/2019 8:00:00 AM to 8/21/2019 9:00:00 AM 

Busy from 8/21/2019 11:45:00 AM to 8/21/2019 1:15:00 PM 

Busy from 8/22/2019 8:00:00 AM to 8/22/2019 9:00:00 AM 

Busy from 8/22/2019 10:00:00 AM to 8/22/2019 11:00:00 AM 

Busy from 8/22/2019 11:45:00 AM to 8/22/2019 1:15:00 PM 

Busy from 8/23/2019 8:00:00 AM to 8/23/2019 9:00:00 AM 

Busy from 8/23/2019 9:00:00 AM to 8/23/2019 9:30:00 AM 

Busy from 8/23/2019 10:00:00 AM to 8/23/2019 10:15:00 AM 

Busy from 8/23/2019 11:45:00 AM to 8/23/2019 1:15:00 PM 

Busy from 8/23/2019 2:00:00 PM to 8/23/2019 2:30:00 PM 

Busy from 8/23/2019 3:45:00 PM to 8/23/2019 4:00:00 PM 

Busy from 8/23/2019 4:30:00 PM to 8/23/2019 4:35:00 PM 

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax