List Teams Channel Meetings from a Users Calendar

During a recently migration project, I had an issue passed to me which required me to create a script to find all Teams channel meetings with specific users calendars. During the migration, Teams meetings were recreated to reflect the destination tenant but due to a limitation of the migration tool, this didn’t include Teams channel meetings. We then needed to find where users had channel meetings present in their calendars.

To find these meetings, I created a script which I have made available on GitHub to report on channel meetings from a users calendar. This simple script takes an array of email addresses belonging to your Teams. It then loops through events in a specific users calendar to determine which have been created by the Team, highlighting the Teams meetings in the output.

It’s not prticularly complex and does not provide a huge about of information on it’s own but built into a larger report can help identify these meetings quickly. Unfortunatly the Microsoft Graph API does not support filtering on nested values currently so the script must return all meetings for a specific user before filtering but it gets the job done!

connect-mggraph -Scopes Calendars.Read

##Variable to contain all of the team email addresses
$EmailAddresses = @(
    "serviceteam@seanmcavinue.net",
    "PlannerGroup@seanmcavinue.net"
)


##Replace userID with each user you want to check
$Events = get-mguserevent -userid db3a70f1-8e82-4a6d-a936-4695f1f7702a -All
    
    
foreach ($Event in $Events) {
    if ($EmailAddresses -contains $Event.Organizer.EmailAddress.Address) {
        $Event | fl CreatedDateTime, Subject, Organizer
    }else{
        #write-host $event.Organizer.EmailAddress.Address -ForegroundColor red
    }
}

Make sure to customize the variable and UserID in the script for your environment, then add your next steps within the IF statement to integrate this into your current reporting!.

Leave a comment