turbot/microsoft365
steampipe plugin install microsoft365

Table: microsoft365_my_calendar - Query Microsoft 365 Calendars using SQL

Microsoft 365 Calendar is a time-management and scheduling calendar service developed by Microsoft. It allows users to view, schedule, and manage appointments and meetings. This service is integrated with Outlook and provides shared calendars, scheduling assistant, and calendar events among its features.

Table Usage Guide

The microsoft365_my_calendar table provides insights into personal calendar events within Microsoft 365. As a project manager or team lead, you can explore event-specific details through this table, including event schedules, attendees, and associated metadata. Utilize it to gain a comprehensive view of your personal calendar events, such as meetings, appointments, and reminders.

Important Notes

  • If not authenticating with the Azure CLI, this table requires the user_id argument to be configured in the connection config.

Examples

Basic info

Explore which calendars in your Microsoft 365 account have been set as default and can be edited. This is useful to understand your meeting scheduling preferences and the default online meeting provider.

select
name,
is_default_calendar,
can_edit,
default_online_meeting_provider
from
microsoft365_my_calendar;
select
name,
is_default_calendar,
can_edit,
default_online_meeting_provider
from
microsoft365_my_calendar;

List calendars the user can edit

Explore which calendars the user has editing permissions for, which can be useful for managing access rights and understanding the default online meeting providers associated with each calendar.

select
name,
can_edit,
default_online_meeting_provider
from
microsoft365_my_calendar
where
can_edit;
select
name,
can_edit,
default_online_meeting_provider
from
microsoft365_my_calendar
where
can_edit;

List permissions for each calendar

Discover the segments that have different permissions within each calendar. This can be useful in understanding the access levels of various roles and individuals in your organization, helping to maintain security and control.

select
c.name,
p -> 'allowedRoles' as permission_allowed_roles,
p -> 'emailAddress' as permission_email_address,
p ->> 'id' as permission_id,
p -> 'isInsideOrganization' as permission_inside_organization,
p -> 'isRemovable' as permission_is_removable,
p ->> 'role' as permission_role
from
microsoft365_my_calendar as c,
jsonb_array_elements(permissions) as p;
select
c.name,
json_extract(p.value, '$.allowedRoles') as permission_allowed_roles,
json_extract(p.value, '$.emailAddress') as permission_email_address,
json_extract(p.value, '$.id') as permission_id,
json_extract(p.value, '$.isInsideOrganization') as permission_inside_organization,
json_extract(p.value, '$.isRemovable') as permission_is_removable,
json_extract(p.value, '$.role') as permission_role
from
microsoft365_my_calendar as c,
json_each(c.permissions) as p;

Schema for microsoft365_my_calendar

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
allowed_online_meeting_providersjsonbRepresent the online meeting service providers that can be used to create online meetings in this calendar. Possible values are: unknown, skypeForBusiness, skypeForConsumer, teamsForBusiness.
calendar_group_idtext=The ID of the group.
can_editbooleanTrue if the user can write to the calendar, false otherwise.
can_sharebooleanTrue if the user has the permission to share the calendar, false otherwise. Only the user who created the calendar can share it.
can_view_private_itemsbooleanTrue if the user can read calendar items that have been marked private, false otherwise.
change_keytextIdentifies the version of the calendar object. Every time the calendar is changed, changeKey changes as well.
colortextSpecifies the color theme to distinguish the calendar from other calendars in a UI. The property values are: auto, lightBlue, lightGreen, lightOrange, lightGray, lightYellow, lightTeal, lightPink, lightBrown, lightRed, maxColor.
default_online_meeting_providertextThe default online meeting provider for meetings sent from this calendar. Possible values are: unknown, skypeForBusiness, skypeForConsumer, teamsForBusiness.
hex_colortextThe calendar color, expressed in a hex color code of three hexadecimal values, each ranging from 00 to FF and representing the red, green, or blue components of the color in the RGB color space.
idtext=The calendar's unique identifier.
is_default_calendarbooleanTrue if this is the default calendar where new events are created by default, false otherwise.
is_removablebooleanIndicates whether this user calendar can be deleted from the user mailbox.
is_tallying_responsesbooleanIndicates whether this user calendar supports tracking of meeting responses. Only meeting invites sent from users' primary calendars support tracking of meeting responses.
multi_value_extended_propertiesjsonbThe collection of multi-value extended properties defined for the calendar.
nametextThe calendar name.
ownerjsonbRepresents the user who created or added the calendar.
permissionsjsonbRepresents the user who created or added the calendar.
tenant_idtextThe Azure Tenant ID where the resource is located.
titletextTitle of the resource.
user_idtextID or email of the user.

Export

This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.

You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh script:

/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- microsoft365

You can pass the configuration to the command with the --config argument:

steampipe_export_microsoft365 --config '<your_config>' microsoft365_my_calendar