EWS to see shared calendars

Welcome Forums General PowerShell Q&A EWS to see shared calendars

This topic contains 1 reply, has 1 voice, and was last updated by

2 years, 6 months ago.

  • Author
  • #57352

    Topics: 21
    Replies: 30
    Points: 0
    Rank: Member

    Is it possible to use EWS API to see shared calendars that are attached to my outlook profile?

    I'm using this code:

    # Your mailbox here
    $mailboxName = "me@domain.com"
    Add-Type -Path "C:\Program Files\Microsoft\Exchange\Web Services\2.2\Microsoft.Exchange.WebServices.dll"  
    $version = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2013
    $service = new-object Microsoft.Exchange.WebServices.Data.ExchangeService($version)  
    $service.UseDefaultCredentials = $true  
    $folderid = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Calendar, $mailboxName)
    $calendarFolder = [Microsoft.Exchange.WebServices.Data.calendarFolder]::Bind($service, $folderid)
    $calendarView = new-object Microsoft.Exchange.WebServices.Data.CalendarView([System.DateTime]::Now, [System.DateTime]::Now.AddDays(720))
    $calendarView.MaxItemsReturned = 200;
    $calendarView.PropertySet = new-object Microsoft.Exchange.WebServices.Data.PropertySet([Microsoft.Exchange.WebServices.Data.BasePropertySet]::FirstClassProperties)
    $result = $calendarFolder.FindAppointments($calendarView)
    $result | Format-Table

    $folderid only returns the generic, 'calendar'.

    Is there a way to pull shared calendars i've attached through outlook?

  • #57353

    Topics: 21
    Replies: 30
    Points: 0
    Rank: Member

    Sorry...I've been looking at this too long...

    I just realized I was putting my user name in, not the shared mailbox user...works fine 😉

The topic ‘EWS to see shared calendars’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort