Scope required to get specific properties with Get-MgUserCalendarView

tk 60 Reputation points
2024-09-30T09:06:17.55+00:00

What scope do I need to get the properties?

Command
Get-MgUserCalendarView

Properties
・Start
・End
・Organizer
・Subject
・IsAllDay
・IsReminderOn
・Attendees
・Location
・Body
・Sensitivity
・Categories
・Importance
・ReminderMinutesBeforeStart

Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

Answer accepted by question author
  1. Hitesh Pachipulusu - MSFT 3,635 Reputation points Microsoft External Staff
    2024-09-30T10:07:47.1+00:00

    Hello tk_kop,

    Thank you for reaching out to Microsoft Support!

    To retrieve the properties you listed using the Get-MgUserCalendarView command, you need the Calendars.Read or Calendars.Read.Shared scope, depending on whether you are accessing your own calendar or a shared calendar. These scopes allow you to read calendar events and their details.

    Here’s an example of how you might structure the command to include the properties you mentioned:

    Connect-MgGraph -Scopes "Calendars.Read","Calendars.Read.Shared"
    $view=Get-MgUserCalendarView -UserId "user@example.com" -StartDateTime "2024-09-01T00:00:00Z" -EndDateTime "2024-09-30T23:59:59Z" 
    $view.start
    $view.end
    $view.organizer
    $view.subject
    $view.isAllDay
    

    Make sure to replace "user@example.com" with the actual user ID and adjust the date range as needed.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,416 Reputation points
    2024-09-30T10:41:56.4566667+00:00

    Hi @tk_kop

    It requires the Calendars.Read delegate permission.

    7ded8f63-eef2-458d-b400-9f4d9abe170b

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.