ComplianceSearch Syntax

Glenn Maxwell 14,311 Reputation points
2026-11-15T18:47:22.1333333+00:00

Hi All,

I have a requirement to remove two specific occurrences (November 18 and November 25) of a recurring meeting from all users' calendars while keeping the remaining occurrences of the recurring meeting series intact.

I understand that using the Microsoft Purview Compliance Search and Hard Delete approach, as shown in the commands below, could delete the entire meeting series rather than just the two specific occurrences.

I would like to know whether there is a supported way to delete only the November 18 and November 25 occurrences from all users' calendars without impacting the remaining instances of the recurring meeting.

Additionally, I have a couple of questions regarding time zone handling:

  1. I am running IPSS PowerShell from a VM configured with the Pacific Time (PT) time zone. Does the Compliance Search query or purge operation use the VM's local time zone, UTC, or the time zone associated with the calendar item?
  2. The meeting date may appear as November 18 in some users' calendars and November 19 in others, depending on their respective time zones. How can I accurately identify the correct occurrence to delete across all users' calendars?
  3. Is there a recommended Exchange Online PowerShell approach or supported cmdlet to remove specific occurrences of a recurring meeting series across multiple mailboxes?

I would appreciate guidance on the correct PowerShell syntax and recommended approach to achieve this without deleting the entire recurring meeting series.

Commands currently i am using is:

$users = Import-Csv -Path "C:\list.csv"
$searchName = "RemoveMI"
$subject = "Meeting1"
$searchQuery = "subject:`"$subject`" AND kind:meetings AND (from:`"user1[@]mydomain.com`")"
New-ComplianceSearch -Name $searchName -ExchangeLocation $users.EmailAddress -ContentMatchQuery $searchQuery -AllowNotFoundExchangeLocationsEnabled $true
Start-ComplianceSearch -Identity $searchName
New-ComplianceSearchAction -SearchName "Meeting1" -Purge -PurgeType HardDelete -Force
Get-ComplianceSearchAction -Identity "Meeting1_Purge"

Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Ivory 2,900 Reputation points Independent Advisor
    2026-11-15T19:17:23.6966667+00:00

    Hi Glenn,

    There is currently no supported Exchange Online PowerShell cmdlet or Purview purge method to selectively remove individual occurrences of a recurring meeting series across multiple mailboxes. The recommended administrative approach is Microsoft Graph, or alternatively cancelling the specific occurrences from the organizer's copy of the meeting when possible.

    Compliance Search and Purge is designed for content removal rather than calendar maintenance. Recurring meetings are represented by a recurring master item with associated occurrences and exceptions. Because Compliance Search isn't designed to target individual instances within a recurring series, a purge may act on the recurring master item and could result in removal of the entire series. For this reason, Purview is not recommended for selectively removing only specific occurrences from a recurring meeting.

    The Exchange Online PowerShell cmdlet Remove-CalendarEvents is intended for organizer scenarios and is commonly used to cancel meetings within a date range. It is not designed to remove selected occurrences from a recurring series while preserving the remaining instances. Therefore, it would not be appropriate for this requirement.

    The Compliance Search and purge process runs within Microsoft 365 services and does not use the local time zone configured on the workstation or VM running PowerShell.

    When dealing with attendees in different time zones, the same meeting occurrence can appear on different calendar dates. For example, an occurrence displayed as November 18 for one user may appear as November 19 for another user. To accurately identify the same occurrence across all mailboxes, it is recommended to use the occurrence's UTC start time rather than the date displayed in each user's calendar.

    When using Microsoft Graph, you can request event data in UTC by including the following header:

    Prefer: outlook.timezone="UTC"

    This allows the same occurrence to be identified consistently regardless of each user's mailbox time zone.

    If the organizer still exists and can manage the meeting, the preferred and fully supported solution is to cancel the November 18 and November 25 occurrences from the organizer's calendar and send updates to attendees. Exchange Online will then propagate the cancellations to attendee calendars while preserving the rest of the series.

    If an administrative solution is required across many mailboxes, Microsoft Graph is the recommended approach. Graph exposes individual occurrences of a recurring meeting as separate event instances, allowing administrators to:

    1. Enumerate the occurrences of the recurring meeting.
    2. Identify the target occurrences using their UTC start times.
    3. Delete only those specific event instances.

    For reference:

    Remove-CalendarEvents (ExchangePowerShell) | Microsoft Learn

    List calendarView - Microsoft Graph v1.0 | Microsoft Learn

    Delete event - Microsoft Graph v1.0 | Microsoft Learn

    event: cancel - Microsoft Graph v1.0 | Microsoft Learn

    Search for and delete email messages in your organization | Microsoft Learn

    If you have any questions or need further assistance, please feel free to share them in the comments on this post.


    If the answer is helpful, please click 'Yes' and kindly upvote it.

    Note: Please follow the steps in the forum documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    Was this answer helpful?


  2. AI answer

    2026-11-15T18:49:02.79+00:00

    Cancel the two occurrence event IDs from the organizer’s calendar with Microsoft Graph; do not use Compliance Search purge or Remove-CalendarEvents, because neither provides safe occurrence-level removal for this scenario.

    Microsoft Graph can return expanded instances through calendarView. Supplying an occurrence event ID to the cancel operation cancels only that occurrence and sends the cancellation to attendees. The caller must operate as the organizer and have Calendars.ReadWrite; an attendee receives HTTP 400 when attempting cancellation.^1^^2^

    The following delegated PowerShell example uses an explicit UTC interval. Replace the year, organizer, subject, and expected UTC start times with the actual values.

    Import-Module Microsoft.Graph.Authentication
    Import-Module Microsoft.Graph.Calendar
    
    $organizer = "[Email]"
    Connect-MgGraph -Scopes "Calendars.ReadWrite"
    
    $events = Get-MgUserCalendarView -UserId $organizer `
        -StartDateTime "2026-11-18T00:00:00Z" `
        -EndDateTime   "2026-11-26T23:59:59Z" `
        -Property "id,subject,start,end,organizer,type,seriesMasterId" `
        -All
    
    $events |
        Where-Object Subject -eq "Meeting1" |
        Select-Object Id,Subject,Type,SeriesMasterId,Start,End,Organizer
    

    Review that output before making changes. Select events only when all these values agree:

    • Subject is the intended meeting.
    • Organizer.EmailAddress.Address is the expected organizer.
    • Type identifies an occurrence or exception, not the series master.
    • Both events have the same expected SeriesMasterId.
    • Start.DateTime represents the intended meeting instant after accounting for Start.TimeZone.

    Abort if more than one series or unexpected event is returned. Then assign the two reviewed occurrence IDs and cancel them:

    $occurrenceIds = @(
        "<validated-November-18-occurrence-ID>",
        "<validated-November-25-occurrence-ID>"
    )
    
    $params = @{ Comment = "These two occurrences have been cancelled." }
    
    foreach ($eventId in $occurrenceIds) {
        Stop-MgUserEvent -UserId $organizer `
            -EventId $eventId `
            -BodyParameter $params
    }
    

    Stop-MgUserEvent is the Graph PowerShell command for cancelling a specified user event.^3^

    This is destructive and sends cancellations, so test against one nonproduction series first. For unattended tenant automation, use application authentication instead of delegated authentication. The application still requires admin-consented Calendars.ReadWrite; restrict its mailbox access to the required mailboxes where your authorization design supports that.

    Time-zone handling

    The VM’s Pacific time zone does not control an eDiscovery query. Purview eDiscovery searches use UTC, and that search time zone cannot be changed.^4^ KeyQL date/time values must likewise be specified in UTC.^5^

    For Graph discovery:

    • Supply explicit ISO 8601 UTC values ending in Z, or explicit numeric offsets.
    • Search a UTC interval wide enough to include both possible displayed local dates.
    • Match the occurrence by its absolute start instant, organizer, subject, and series ID—not merely by “November 18.”
    • A meeting can display as November 18 for one attendee and November 19 for another while still representing the same occurrence.

    Graph interprets a calendarView boundary without an offset as UTC, so explicit offsets avoid ambiguity.^1^

    Why the Exchange and Purview commands should not be used

    Remove-CalendarEvents is unsuitable: if any instance of a recurring meeting falls inside its query window, it cancels the entire series, not only instances within that window.^6^

    Compliance Search is designed to find indexed mailbox items, and purge is primarily intended for data-spillage response—not precise calendar-series maintenance. Purge is also limited to 10 items per mailbox per operation and requires the Purview Search And Purge role.^7^ A subject/from query can match the recurring master or associated meeting messages; it does not reliably select two expanded calendar occurrences.

    Also, the posted commands create $searchName = "RemoveMI" but invoke the purge against "Meeting1". That identity mismatch would target a different search or fail. It should not be corrected and executed for this requirement because the underlying purge method remains unsafe.

    If organizer cancellation is impossible

    If the organizer mailbox cannot issue cancellations, each attendee copy must be processed individually using the Graph delete operation and that mailbox’s occurrence ID:

    Remove-MgUserEvent -UserId $attendeeUpn -EventId $occurrenceId
    

    The application needs Calendars.ReadWrite access to every processed mailbox. Deleting attendee copies does not issue an organizer cancellation; deleting from the organizer’s calendar does.^8^ Prefer organizer cancellation because it updates attendee calendars through the meeting lifecycle rather than independently modifying every mailbox.

    EWS can also address an individual occurrence by occurrence item ID, but it should not be selected for new Exchange Online automation: EWS disablement began in October 2026 as part of its retirement, and Microsoft recommends migration to Graph.^9^


    References

    1. Delegate access and calendar sharing with Microsoft Graph
    2. event: cancel
    3. Imports the Microsoft.Graph.Calendar PowerShell module and uses the Stop-MgUserEvent cmdlet to cancel a calendar event for a specified user, optionally includin...
    4. Create a search for a case in eDiscovery
    5. Keyword Query Language (KeyQL) syntax reference
    6. Remove-CalendarEvents-Syntax
    7. Find and delete email messages in eDiscovery
    8. Delete event
    9. Deprecation of Exchange Web Services in Exchange Online
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.