How to Track the Creation of Teams Meeting Recordings in OneDrive for Business and SharePoint Online

How Administrators Can Find Out When Recordings Occur

Recently, I published two posts explaining how auto-label retention policies for Teams meeting recordings work and how to validate that an auto-label policy works. All is well, and the auto-label policy apply the right retention labels to the right files in the right locations, which is what you want.

The inevitable question then arose: how can administrators know when someone records a Teams meeting? The book answer is that neither Teams nor Office 365 offer an obvious way to know when a new recording happens. Recording is, after all, a personal action decided by the meeting organizer or a presenter (or invoked automatically by a meeting setting). Once the meeting policy assigned to the organizer or presenter allows them to use “cloud recording,” Teams records the meeting and captures the MP4 file in OneDrive for Business (personal meetings) or SharePoint Online (channel meetings).

Recording a meeting is not an auditable activity so it’s not captured in the Office 365 audit log. However, the creation of a new file in OneDrive for Business or SharePoint Online is auditable, so we can examine those events to see if we can track new recordings.

Audit Events for a Teams Meeting Recording

First, let’s consider what happens on the creation of a new Teams meeting recording. Three events appear in the audit log:

  • Creation of a temporary MP4 file in a FileUploaded event.
  • Modification of the temporary file in a FileModified event. This is likely when Teams updates the properties of the file to add the programmatic identifiers Media and Meeting which mark the file as a Teams meeting recording.
  • Renaming the file name of the temporary file to its final form. This is also in a FileModified event. The temporary file has a prefix of “~tmp.” Teams removes the prefix to create the final file name in the form meeting name, date, and “meeting recording.” For example, the file called H2 FY2021 Review 20210615_140058-Meeting Recording.mp4 is for a Teams meeting on June 15, 2021, starting at 14:00:58 (local).

Equipped with this knowledge, we can search the audit log with the Search-UnifiedAuditLog cmdlet and parse the audit events to extract data for analysis.

PowerShell Script to Find Creation of Teams Meeting Recordings

The PowerShell code is straightforward:

  • Use the Search-UnifiedAuditLog cmdlet to retrieve the set of audit events for FileModified and FileUploaded actions over a set period (I used 14 days).
  • Parse the AuditData content in each audit event to figure out if it’s a Teams recording. The basic test used is that the file is an MP4 stored in the /Recordings folder.
  • Extract information about the recording and write to a PowerShell list. For instance, it’s good to know the title of the meeting.
  • Finally, extract the records for the temporary file to create a set for the final creation of Teams meeting recordings. Output this data to the screen with Out-GridView and to a CSV file.

Here’s the main processing loop:

[array]$Records = (Search-UnifiedAuditLog -Operations FileUploaded, FileModified -StartDate $StartDate -EndDate $EndDate -Formatted -ResultSize 5000)

If (!($Records)) {Write-Host "No audit records found - exiting!"; break}

$TaggedRecordings = [System.Collections.Generic.List[Object]]::new() 	
ForEach ($Rec in $Records) {
   $AuditData = $Rec.AuditData | ConvertFrom-Json
   If (($AuditData.SourceFileExtension -eq "mp4") -and ($AuditData.SourceRelativeUrl -like "*/Recordings")) { 
      $RecordingFileName = $AuditData.SourceFileName
      $DateLoc = $RecordingFileName.IndexOf("-202")
      If ($DateLoc -eq -1) {$Topic = $RecordingFileName} Else {$Topic = $RecordingFileName.SubString(0,$DateLoc)}
      $DataLine = [PSCustomObject] @{
         Workload            = $AuditData.Workload
         Date                = $Rec.CreationDate
         User                = $Rec.UserIds
         Recording           = $RecordingFileName
         "Meeting title"     = $Topic
         Site                = $AuditData.SiteURL
         FullURL             = $AuditData.ObjectId
         Folder              = $AuditData.SourceRelativeURL
         Operation           = $Rec.Operations }
    $TaggedRecordings.Add($DataLine) 

   } #End If
} #End For

Figure 1 shows the output as viewed through Out-GridView.

Viewing audit log data for the creation of Teams meeting recordings
Figure 1: Viewing audit log data for the creation of Teams meeting recordings

You can download the complete script from GitHub.

Search-UnifiedAuditLog can return up to 50,000 audit events from the log. In large tenants where many document events accrue daily, you might exceed this number of audit events in a couple of days or even sooner. In this situation, you’ll need to fetch audit events and store them in another repository and analyze them from there.

Exploit the Audit Log

People sometimes complain when they can’t find a simple off-the-shelf option in a Microsoft 365 administration GUI to do something. The Office 365 audit log contains lots of interesting information which answers many questions, like who’s creating Teams meeting recordings. You only have to look. Or rather, know where to look.


Learn how to exploit the Office 365 data available to tenant administrators through the Office 365 for IT Pros eBook. We love figuring out how things work.

15 Replies to “How to Track the Creation of Teams Meeting Recordings in OneDrive for Business and SharePoint Online”

  1. Thank you for sharing this. While, as you mentioned, there is currently “no simple off-the-shelf option”, it’s good to know it is possible to parse out this information when we need to track down if a meeting was recorded. Thanks for taking the time to put this together.

  2. Cannot process argument transformation on parameter ‘StartDate’. Cannot convert null to type “Microsoft.Exchange.ExchangeSystem.ExDateTime”.
    + CategoryInfo : InvalidData: (:) [Search-UnifiedAuditLog], ParameterBindin…mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Search-UnifiedAuditLog
    + PSComputerName : outlook.office365.com

    1. What is $StartDate defined as? The script does this to set the start date for the search to be 14 days before the current date.

      $StartDate = (Get-Date).AddDays(-14); $EndDate = (Get-Date) # Set your own date span here!
      $OutputCSVFile = “C:\temp\AuditEventsTeamsRecordings.csv”

      # Find the audit records
      [array]$Records = (Search-UnifiedAuditLog -Operations FileUploaded, FileModified -StartDate $StartDate -EndDate $EndDate -Formatted -ResultSize 5000)

  3. Thank you for this. I’m not sure why, but when I run this for -180 days I get 2 entries. But if I modify this to run for 10 day increments I get a few hundred. Why would a larger date range return such few results?

    1. Because Office 365 keeps items in the audit log for only 90 days if accounts have Office 365 E3 licenses. To go back further, you need Office 365 E5 (to 365 days).

  4. Hi Tony. The bulk of our users have E1. Whether I set the time frame for -14 or -90 days I only see recordings created today. Thoughts?:
    $StartDate = (Get-Date).AddDays(-90); $EndDate = (Get-Date) # Set your own date span here!
    Workload Date
    OneDrive 7/21/2022 19:46
    OneDrive 7/21/2022 19:31
    OneDrive 7/21/2022 19:23
    OneDrive 7/21/2022 19:08
    OneDrive 7/21/2022 19:06
    OneDrive 7/21/2022 18:43
    OneDrive 7/21/2022 18:37
    OneDrive 7/21/2022 18:29

      1. I’m having the same issue and I could see the records in the Audit search feature of the Purview compliance porta

  5. I don’t know what’s going on. I ran the script just now and it worked perfectly. Obviously, I can’t see your data. By any chance are the locations of the recordings stored in OneDrive somewhere other than Recordings? I don’t know if OneDrive (or Teams) creates a localized folder name to store recordings in, but the script looks for them in the Recordings folder…

  6. I am unable to see data other thaan for today only although the script is set to start date 14 days ago

  7. We are having the same issue, all our people are E3 users but if I modify the script for 90 days it still only returns data for the current day.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.