New-MgUserCalendarEvent

What is New-MgUserCalendarEvent?

New-MgUserCalendarEvent is a Microsoft Graph PowerShell cmdlet used to create new calendar events in a user’s Microsoft 365 mailbox. It supports creating both offline (in-person) and online (Teams) meetings with full control over event details.

🚀 Community Edition Released!

Try the M365Corner Microsoft 365 Reporting Tool — your DIY pack with 20+ out-of-the-box M365 reports for Users, Groups, and Teams.

Why Use New-MgUserCalendarEvent?

This cmdlet is ideal for automation scenarios such as:

  • Programmatically scheduling meetings for users
  • Creating calendar events during onboarding or project setup
  • Automating recurring or bulk meeting creation
  • Integrating external systems with Microsoft 365 calendars

It eliminates manual scheduling and ensures consistency across calendar events.


Prerequisites

Before using this cmdlet, connect to Microsoft Graph with calendar write permissions:

Connect-MgGraph -Scopes "Calendars.ReadWrite"

How to use New-MgUserCalendarEvent?

Basic syntax:

New-MgUserCalendarEvent -UserId  <String> -BodyParameter <IMicrosoftGraphEvent>

The event details (subject, start, end, attendees, location, etc.) must be passed using the
-BodyParameter hashtable.


New-MgUserCalendarEvent Examples

  • Example 1: Creating an Offline Meeting
  • This example creates a meeting scheduled in a physical location.

    $eventDetails = @{
        subject = "Project Kickoff Meeting"
        start = @{
            dateTime = "2024-08-20T10:00:00"
            timeZone = "Pacific Standard Time"
        }
        end = @{
            dateTime = "2024-08-20T11:00:00"
            timeZone = "Pacific Standard Time"
        }
        location = @{
            displayName = "Conference Room 1"
        }
        attendees = @(
            @{
                emailAddress = @{
                    address = "john.doe@domain.com"
                }
                type = "Required"
            }
        )
    }
    
    New-MgUserCalendarEvent -UserId "user@domain.com" -BodyParameter $eventDetails
                                                
  • Example 2: Creating an Online Meeting
  • This example creates an online Microsoft Teams meeting.

    $eventDetails = @{
        subject = "Weekly Sync"
        start = @{
            dateTime = "2024-08-21T14:00:00"
            timeZone = "Pacific Standard Time"
        }
        end = @{
            dateTime = "2024-08-21T15:00:00"
            timeZone = "Pacific Standard Time"
        }
        location = @{
            displayName = "Online"
        }
        isOnlineMeeting = $true
        onlineMeetingProvider = "teamsForBusiness"
        attendees = @(
            @{
                emailAddress = @{
                    address = "team.member@domain.com"
                }
                type = "Required"
            }
        )
    }
    
    New-MgUserCalendarEvent -UserId "user@domain.com" -BodyParameter $eventDetails
                                                

Summary

Key Point Details
Cmdlet Name New-MgUserCalendarEvent
Purpose Creates calendar events for a user
Required Scope Calendars.ReadWrite
Input Method Event details via BodyParameter
Automation Benefit Enables automated meeting scheduling
Common Use Case Creating offline or Teams meetings programmatically

Did You Know? Managing Microsoft 365 applications is even easier with automation. Try our Graph PowerShell scripts to automate tasks like generating reports, cleaning up inactive Teams, or assigning licenses efficiently.

Ready to get the most out of Microsoft 365 tools? Explore our free Microsoft 365 administration tools to simplify your administrative tasks and boost productivity.

© Your Site Name. All Rights Reserved. Design by HTML Codex