script to delete Teams recording older than 2 years

MKHULEKO THABISO NHLAMBO 40 Reputation points
2025-02-11T08:42:00.1033333+00:00

may you please assist with a powershell script for deleting Teams recording older than 2 years for everyone

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,258 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,558 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Prasad-MSFT 8,506 Reputation points Microsoft Vendor
    2025-02-11T11:11:21.1833333+00:00

    Hi MKHULEKO THABISO NHLAMBO, thanks for raising your issue.

    Currently there is no such official documentation or script available which explains how to delete Teams recording older than 2 years for everyone. To achieve your requirements, we recommend you give your feedback in Teams Feedback Portal.

    According to this documentation, Meeting recordings and transcripts have a default expiration time of 120 days. On the expiration date, the recording is moved into the recycle bin and the expiration date field is cleared. If a user recovers a recording from the recycle bin, the meeting expiration setting doesn't delete it again. Usually, the recording is deleted within a day after the expiration date but in rare instances could take as long as five days. The file owner receives an email notification when the recording expires and is directed to the recycle bin if they want to recover the recording.

    Additionally, if you want to set the expiration time using PowerShell, you can run the following command:
    Set-CsTeamsMeetingPolicy -Identity <policy name> -NewMeetingRecordingExpirationDays <days>

    Thanks, 

    Prasad Das

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    0 comments No comments

Your answer

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