Skip to main content

outlook calendar set

Updates a calendar for a user.

Usage

m365 outlook calendar set [options]

Options

-i, --id <id>

ID of the calendar.

-n, --name [name]

New name of the calendar.

--userId [userId]

ID of the user. Specify either userId or userName, but not both.

--userName [userName]

UPN of the user. Specify either userId or userName, but not both.

--calendarGroupId [calendarGroupId]

ID of the calendar group where the calendar belongs. Specify either calendarGroupId or calendarGroupName, but not both.

--calendarGroupName [calendarGroupName]

Name of the calendar group where the calendar belongs. Specify either calendarGroupId or calendarGroupName, but not both.

--color [color]

The color of the calendar in the UI. Allowed values: auto, lightBlue, lightGreen, lightOrange, lightGray, lightYellow, lightTeal, lightPink, lightBrown, lightRed, maxColor.

--isDefault [isDefault]

Mark whether the calendar is the user's default calendar. Allowed values: true, false.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, permissions, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Permissions

ResourcePermissions
Microsoft GraphCalendars.ReadWrite, Calendars.ReadWrite.Shared
note

When using delegated permissions, specifying userId or userName for a different user requires the Calendars.ReadWrite.Shared scope. When the specified user matches the signed-in user, no shared scope is needed.

Examples

Update the name of a calendar for the signed-in user.

m365 outlook calendar set --id 'AAMkAGI2TQpZAAA=' --name 'Team planning'

Change the color of a specific calendar for a user by UPN.

m365 outlook calendar set --id 'AAMkAGI2TQpZAAA=' --userName 'john.doe@contoso.com' --color 'lightGreen'

Mark a calendar as the default calendar for a user.

m365 outlook calendar set --id 'AAMkAGI2TQpZAAA=' --userId 'b743445a-112c-4fda-9afd-05943f9c7b36' --isDefault true

Update a calendar within a specific calendar group by name.

m365 outlook calendar set --id 'AAMkAGI2TQpZAAA=' --name 'Team planning' --calendarGroupName 'My Calendars'

Response

{
"id": "AAMkAGI2TQpZAAA=",
"name": "Team planning",
"color": "auto",
"hexColor": "",
"isDefaultCalendar": false,
"changeKey": "DxYSthXJXEWwAQSYQnXvIgAAIxGttg==",
"canShare": true,
"canViewPrivateItems": true,
"canEdit": true,
"allowedOnlineMeetingProviders": [
"teamsForBusiness"
],
"defaultOnlineMeetingProvider": "teamsForBusiness",
"isTallyingResponses": true,
"isRemovable": false,
"owner": {
"name": "John Doe",
"address": "john.doe@contoso.com"
}
}