Guide

Manage Your Exchange Calendar from the Command Line

Exchange calendar management comes with three options today: EWS (deprecated for Exchange Online in October 2026), PowerShell admin modules that require elevated privileges, or the Microsoft Graph API with Azure AD app registration. The Nylas CLI bypasses all three. It works across Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP providers through a single interface.

By Qasim Muhammad

Exchange calendar access shouldn't require 80 lines of code

You want to list today's meetings, book a conference room, or check a colleague's availability. In Exchange, that means picking one of three paths:

  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 the Nylas CLI

# macOS / Linux (Homebrew)
brew install nylas/nylas-cli/nylas

# Or use the install script (macOS, Linux, WSL)
curl -fsSL https://cli.nylas.com/install.sh | bash

# Windows (PowerShell)
irm https://cli.nylas.com/install.ps1 | iex

2. Connect your Exchange account

Create an application at dashboard-v3.nylas.com and connect your Exchange account. Nylas supports Exchange Online (Microsoft 365) and on-premises Exchange Server. Then authenticate the CLI:

nylas auth config
# Paste your API key when prompted

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

3. List calendar events

# Show upcoming events (next 7 days)
nylas calendar events list

# Next 14 days
nylas calendar events list --days 14

# Show timezone info
nylas calendar events list --show-tz

# Convert to a specific timezone
nylas calendar events list --timezone America/Chicago

Example output

$ nylas calendar events list --days 7

Budget Review
  When: Fri, Mar 28, 2026, 10:00 AM - 11:00 AM
  Location: Conference Room B (Floor 3)
  Guests: 4 participant(s)
  ID: event_abc123

Sprint Planning
  When: Mon, Mar 30, 2026, 9:00 AM - 10:00 AM
  Guests: 8 participant(s)
  ID: event_def456

Found 6 event(s)

4. Create events

# Basic event
nylas calendar events create \
  --title "Architecture Review" \
  --start "2026-04-01 14:00" \
  --end "2026-04-01 15:00"

# With participants
nylas calendar events create \
  --title "Design Sync" \
  --start "2026-04-02 10:00" \
  --end "2026-04-02 10:30" \
  --participant alice@company.com \
  --participant bob@company.com

# All-day event
nylas calendar events create \
  --title "Company Offsite" \
  --start "2026-04-15" \
  --all-day

# With location
nylas calendar events create \
  --title "Client Meeting" \
  --start "2026-04-03 13:00" \
  --end "2026-04-03 14:00" \
  --location "Building 4, Room 201"

5. Update and delete events

# Reschedule an event
nylas calendar events update event_abc123 \
  --start "2026-04-01 15:00" \
  --end "2026-04-01 16:00"

# Change the title
nylas calendar events update event_abc123 \
  --title "Architecture Review (Rescheduled)"

# Add a participant to an existing event
nylas calendar events update event_abc123 \
  --participant charlie@company.com

# Delete an event
nylas calendar events delete event_abc123

6. Check availability

Exchange free/busy lookups normally require the GetUserAvailability EWS operation or the Graph API's /calendar/getSchedule endpoint. The CLI wraps both:

# Check your own availability
nylas calendar availability check

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

# Find time for a longer meeting
nylas calendar find-time \
  --participants team-lead@company.com,pm@company.com \
  --duration 1h

7. JSON output for scripting

Pipe calendar data into jq for reporting, monitoring, or integration with other tools:

# Get today's events as JSON
nylas calendar events list --days 1 --json

# Count meetings per day this week
nylas calendar events list --days 7 --json | \
  jq -r '.[] | .when.start_time' | \
  cut -d'T' -f1 | sort | uniq -c

# Extract all participant emails from upcoming meetings
nylas calendar events list --days 7 --json | \
  jq -r '[.[] | .participants[]?.email] | unique | .[]'

# Find events with no location set (useful for room booking audits)
nylas calendar events list --days 14 --json | \
  jq '[.[] | select(.location == null or .location == "")] | length'

EWS vs Graph API vs Nylas CLI

How the three approaches compare for common calendar operations:

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 --grant 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

Room booking

Exchange room mailboxes have their own calendars. Connect each room as a separate grant in the Nylas dashboard, then book directly:

# Book a conference room
nylas calendar events create \
  --grant "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 find-time \
  --participants conf-room-3b@company.com \
  --duration 1h

About 73% of organizations with 500+ Exchange seats use room mailboxes, according to Microsoft 365 admin adoption reports. The CLI removes the need to build a custom room finder app.

Shared calendars

Team calendars, department calendars, and holiday calendars work the same way. Connect the shared calendar's mailbox as a grant:

# View the team calendar
nylas calendar events list --grant "engineering-cal@company.com"

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

Recurring meetings

Exchange handles recurrence through the Recurrence element in EWS or the recurrence property in Graph. The CLI creates recurring events with flags:

# 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 Teams meeting links. When Nylas creates an event with participants on an Exchange Online tenant that has Teams enabled, the Teams meeting link is generated automatically by Exchange. The link appears in the event body and the onlineMeeting property when you list 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}'

Hybrid deployments

Organizations running both Exchange Online and on-premises Exchange Server face a split: some mailboxes live in the cloud, others on-prem. The CLI handles both transparently. Nylas routes Exchange Online requests through Microsoft Graph and on-prem requests through EWS with autodiscover. You don't need to know which backend a mailbox uses.

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

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

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

Next steps