Guide

Exchange Calendar CLI: Manage Events

Use an Exchange Calendar CLI to list events, create meetings, book rooms, and check availability from terminal. Exchange calendar management comes with three options today: EWS, PowerShell admin modules that require elevated privileges, or the Microsoft Graph API with Azure AD app registration.

Written by Prem Keshari Senior SRE

Reviewed by Hazik

VerifiedCLI 3.1.1 · Exchange Calendar · last tested April 11, 2026

How do you use an Exchange Calendar CLI from terminal?

Connect Exchange Online or on-prem Exchange once, then use nylas calendar events list, nylas calendar events create, and nylas calendar availability find. This gives you an Exchange Calendar CLI workflow without EWS SOAP, Exchange PowerShell, or Graph API setup.

Exchange calendar access should not require 80 lines of code.

Exchange calendar automation forces developers to choose between three paths, each with steep setup costs. EWS requires roughly 40 lines of SOAP XML to list events. Microsoft Graph needs Azure AD app registration, OAuth2 token handling, and OData pagination — around 60 lines of boilerplate before you read a single event. The Nylas CLI replaces all three approaches with one-line commands that work on both Exchange Online and on-premises servers.

  1. EWS (Exchange Web Services) — SOAP-based API that Microsoft is shutting down for Exchange Online in October 2026 (announcement MC862873). On-prem Exchange Server keeps EWS, but online tenants lose it.
  2. PowerShell — The ExchangeOnlineManagement module requires admin credentials. The Get-CalendarDiagnosticLog and Get-CalendarProcessing cmdlets are admin-only tools, not user-level calendar access.
  3. Microsoft Graph API — Register an Azure AD app, configure Calendars.ReadWrite permissions, handle OAuth2 token acquisition and refresh, then parse OData JSON responses with $top/$skip pagination.

The Nylas CLI handles the protocol layer. You run nylas calendar events list and get your events. Same command whether you're on Exchange Online, on-prem Exchange Server 2016/2019, or a hybrid deployment.

1. Install

Installing the Nylas CLI takes under 2 minutes on macOS and Linux via Homebrew, with no additional packages needed for Exchange connectivity. The CLI handles EWS and Graph API protocols internally, so there are no separate SDKs or SOAP libraries to configure. Run brew install nylas/nylas-cli/nylas to install, or see the getting started guide for shell script, PowerShell, and Go install methods.

2. Connect your Exchange account

Connecting an Exchange account to the Nylas CLI requires creating an application at the Nylas dashboard and authenticating with an API key. The setup takes about 5 minutes — compared to roughly 60 minutes for Azure AD app registration and OAuth2 configuration required by Microsoft Graph. Nylas supports Exchange Online (Microsoft 365) and on-premises Exchange Server 2016/2019 through the same authentication flow.

Create an application at dashboard-v3.nylas.com, connect your Exchange account as a grant, then authenticate the CLI with your API key. The nylas auth whoami command confirms which provider and identity are active.

nylas auth config
# Paste your API key when prompted

# Verify the connection
nylas auth whoami
# => Authenticated as you@company.com (Exchange)

3. Room booking and resource calendars

Exchange room mailboxes are resource calendars with booking policies, approval rules, and capacity constraints — they behave like full identities rather than simple calendar entries. According to Microsoft's Exchange documentation, organizations with over 500 employees average 15-30 room resources per office, each with distinct policies. Booking a room via EWS requires a FindRooms call followed by a CreateItem SOAP request totaling about 60 lines of XML.

The Nylas CLI books rooms with a single events create command targeting the room mailbox address. Check availability first with nylas calendar availability find to avoid booking conflicts before sending the request.

# Book a conference room
nylas calendar events create \
  "conf-room-3b@company.com" \
  --title "Sprint Demo" \
  --start "2026-04-01 15:00" \
  --end "2026-04-01 16:00" \
  --participant team@company.com

# Check room availability before booking
nylas calendar availability find \
  --participants conf-room-3b@company.com \
  --duration 60

4. Shared calendars and service identities

Exchange organizations rely on shared calendars, executive assistant mailboxes, operations inboxes, and service accounts more heavily than personal-calendar providers like Gmail or Yahoo. A mid-size enterprise with 2,000 Exchange mailboxes typically has 50-100 shared resource and service calendars. Each shared identity needs its own grant in Nylas so that calendar operations run under the correct mailbox context — keeping audit trails clear and access boundaries intact.

Connect each shared mailbox or service account as a separate Nylas grant. The nylas calendar events list command accepts the mailbox address to specify which calendar to query, and nylas calendar list shows all calendars owned by a given identity.

# View a shared team calendar
nylas calendar events list "engineering-cal@company.com"

# Add an event to a shared calendar mailbox
nylas calendar events create \
  "engineering-cal@company.com" \
  --title "Release v4.2" \
  --start "2026-04-10" \
  --all-day

# Inventory the identities your automation depends on
nylas calendar list "executive-assistant@company.com"
nylas calendar list "shared-operations-cal@company.com"

5. Hybrid deployments and mailbox placement

Hybrid Exchange deployments split mailboxes between Exchange Online and on-premises servers, creating a dual-transport problem that no other calendar provider shares. According to Microsoft's 2024 hybrid deployment documentation, over 40% of Exchange organizations run at least some mailboxes on-prem alongside Microsoft 365. The Nylas CLI uses the same command surface for both — the underlying transport (EWS for on-prem, Graph for cloud) changes automatically based on mailbox placement.

Cloud and on-prem mailboxes use identical CLI syntax. The nylas calendar events list and nylas calendar events create commands route through the correct protocol without configuration changes, even when booking a room that lives on-prem while the user account is in the cloud.

# Cloud mailbox
nylas calendar events list "cloud-user@company.com"

# On-prem mailbox (same command, different routing)
nylas calendar events list "onprem-user@company.com"

# Book a room that's on-prem while your account is in the cloud
nylas calendar events create \
  "boardroom@company.com" \
  --title "Quarterly Review" \
  --start "2026-04-15 10:00" \
  --end "2026-04-15 12:00"

Exchange hybrid deployments differ from Outlook in a fundamental way. Outlook calendar management is a Microsoft 365 tenant-policy problem. Exchange calendar automation is a coexistence, autodiscover, and mailbox-placement problem that spans two infrastructure layers.

6. EWS deprecation and migration pressure

Microsoft announced in MC862873 that Exchange Web Services will be retired for Exchange Online in October 2026, giving organizations roughly 18 months from the announcement to migrate every EWS-dependent automation. On-prem Exchange Server 2016 and 2019 keep EWS support, but any automation that touches both cloud and on-prem mailboxes needs a migration path. The Nylas CLI already abstracts the transport layer, so workflows built on it don't require code changes when Microsoft completes the cutoff.

Every Exchange calendar automation should be evaluated as two separate questions: what happens for cloud mailboxes after EWS is gone, and what happens for the on-prem exceptions that remain on EWS indefinitely?

7. Core Exchange calendar commands

The Nylas CLI provides four core calendar operations — list, create, update, and delete — each requiring a single command instead of the 40-60 lines of SOAP XML or OAuth-authenticated HTTP requests needed with EWS or Graph. These commands work identically across Exchange Online and on-prem Exchange Server, with the CLI selecting the correct protocol automatically based on mailbox placement.

The --days flag on nylas calendar events list scopes the query to a rolling window, and --show-tz displays timezone information for each event. Creating, updating, and deleting events uses the event ID returned by the list command.

# List upcoming events
nylas calendar events list --days 14 --show-tz

# Create a standard meeting
nylas calendar events create \
  --title "Architecture Review" \
  --start "2026-04-01 14:00" \
  --end "2026-04-01 15:00" \
  --participant alice@company.com

# Reschedule an event
nylas calendar events update event_abc123 \
  --title "Architecture Review (Rescheduled)" \
  --start "2026-04-01 15:00" \
  --end "2026-04-01 16:00"

# Delete an event
nylas calendar events delete event_abc123

8. Availability and JSON output

Exchange free/busy lookups normally require the GetUserAvailability EWS operation (about 35 lines of SOAP XML) or the Graph API's POST /calendar/getSchedule endpoint (about 30 lines of JSON with OAuth authentication). The Nylas CLI wraps both protocols behind nylas calendar availability check and nylas calendar availability find, returning structured output suitable for audits, migration reporting, and scripted scheduling workflows.

The --json flag on nylas calendar events list outputs event data as JSON, which pipes directly into jq for filtering and aggregation. For example, counting meetings with no room assigned across a 14-day window takes one piped command instead of a custom script.

# Check your own availability
nylas calendar availability check

# Find mutual availability across participants
nylas calendar availability find \
  --participants alice@company.com,bob@company.com \
  --duration 30

# Count meetings with no room assigned
nylas calendar events list --days 14 --json | \
  jq '[.[] | select(.location == null or .location == "")] | length'

EWS vs Graph API vs Nylas CLI

The three approaches to Exchange calendar automation differ significantly in setup time, code volume, and long-term viability. EWS requires approximately 30 minutes of SOAP endpoint configuration and adds 35-60 lines of XML per operation. Microsoft Graph takes about 60 minutes for Azure AD app registration and OAuth2 setup, with 30-60 lines of JSON and authentication code per call. The Nylas CLI reduces setup to roughly 5 minutes and each operation to a single terminal command.

ConcernEWSMicrosoft GraphNylas CLI
Setup time~30 min (SOAP endpoint + autodiscover)~60 min (Azure AD app + OAuth2 + permissions)~5 min (dashboard + API key)
List eventsFindItem SOAP call (~40 lines XML)GET /me/calendar/events (~60 lines with auth)nylas calendar events list
Create eventCreateItem SOAP call (~50 lines XML)POST /me/events (~40 lines JSON + auth)nylas calendar events create
Free/busy lookupGetUserAvailability (~35 lines)POST /calendar/getSchedule (~30 lines)nylas calendar availability check
Room bookingFindRooms + CreateItem (~60 lines)findRooms + POST /events (~50 lines)nylas calendar events create room@co
AuthenticationNTLM, Basic, or OAuth2OAuth2 onlyHandled by Nylas
Exchange OnlineUntil Oct 2026YesYes
On-prem supportYesNoYes (via EWS internally)
PaginationIndexedPageItemView$top / $skip / @odata.nextLink--limit flag
Deprecation riskHigh (Oct 2026 for Online)LowNone (Nylas abstracts)

Exchange-specific tips

Exchange calendar management has several patterns that differ from other providers — recurring meeting syntax, Teams meeting link generation, autodiscover topology, and service account impersonation boundaries. These tips address the most common Exchange-specific scenarios that developers encounter when automating calendar workflows.

Recurring meetings

Exchange handles recurrence through the Recurrence element in EWS or the recurrence property in Graph. In EWS, defining a weekly recurrence pattern requires about 15 lines of XML specifying the WeeklyRecurrence, DaysOfWeek, and NumberedRecurrence elements. The Nylas CLI creates recurring events with a single --recurrence flag that accepts values like "weekly" and "biweekly".

# Weekly standup
nylas calendar events create \
  --title "Team Standup" \
  --start "2026-04-06 09:00" \
  --end "2026-04-06 09:15" \
  --recurrence "weekly" \
  --participant team@company.com

# Biweekly 1:1
nylas calendar events create \
  --title "1:1 with Manager" \
  --start "2026-04-07 11:00" \
  --end "2026-04-07 11:30" \
  --recurrence "biweekly"

Teams meeting integration

Events created through Exchange Online can include Microsoft Teams meeting links automatically. When the Nylas CLI creates an event with participants on an Exchange Online tenant that has Teams enabled, Exchange generates the Teams meeting link server-side — no additional API calls or Teams SDK integration required. According to Microsoft's Teams documentation, tenants with Teams licensing generate online meeting links for approximately 80% of new calendar events with external participants. The link appears in the event body and the conferencing property when listing the event with --json.

# Create an event (Teams link added automatically by Exchange)
nylas calendar events create \
  --title "Design Review" \
  --start "2026-04-03 14:00" \
  --end "2026-04-03 15:00" \
  --participant remote-team@company.com

# Check for the Teams link in JSON output
nylas calendar events list --json | \
  jq '.[] | select(.conferencing != null) | {title: .title, link: .conferencing.details.url}'

Autodiscover and legacy topology

Exchange environments deal with problems that pure-cloud providers like Gmail and Yahoo don't face: autodiscover endpoint resolution, hybrid routing between on-prem and cloud, legacy namespace splits, and mailbox placement across multiple Exchange servers. Organizations running Exchange Server 2016 alongside Exchange Online may have 3-5 autodiscover endpoints active simultaneously. The Nylas CLI abstracts this topology — it resolves the correct endpoint for each mailbox without requiring the developer to know which server or protocol path a mailbox uses.

Autodiscover complexity is the primary reason Exchange calendar automation stays distinct from Outlook calendar automation. Outlook is a Microsoft 365 tenant-policy problem. Exchange is an estate-management problem spanning physical servers, coexistence namespaces, and resource forests.

Service accounts and impersonation boundaries

Exchange organizations rely on EWS impersonation to let a single service account act on behalf of multiple mailboxes — a pattern used by roughly 70% of enterprise Exchange calendar automations, according to Microsoft's EWS best practices documentation. With EWS retiring for Exchange Online in October 2026, every impersonation-based workflow needs a replacement strategy. The Nylas CLI uses separate grants per mailbox instead of impersonation, which keeps each identity's access boundary explicit and auditable.

# Separate grants keep room, shared, and user calendars distinct
nylas calendar events list "executive-assistant@company.com"
nylas calendar events list "room-board-12@company.com"
nylas calendar events list "shared-project-cal@company.com"

Exchange migration checklist for calendar automations

Exchange calendar migration planning requires an inventory of every automation that books rooms, reads shared calendars, or checks free/busy for assistants and resource accounts. A typical enterprise Exchange deployment with 5,000 mailboxes may have 20-50 distinct calendar automations spread across EWS impersonation scripts, PowerShell scheduled tasks, and Graph API integrations. Each automation needs to be classified as cloud-only, on-prem-only, or hybrid to determine whether it survives the October 2026 EWS deprecation unchanged or requires migration.

Use nylas calendar list with each service identity to inventory which mailboxes and calendars each automation depends on. Separate the results into three categories and plan migration paths accordingly.

# Inventory the identities your Exchange automations actually depend on
nylas calendar list "executive-assistant@company.com"
nylas calendar list "boardroom@company.com"
nylas calendar list "shared-operations-cal@company.com"

Next steps