OneDrive Microsoft Teams recordings

MKHULEKO THABISO NHLAMBO 40 Reputation points
2025-02-03T07:40:33.1433333+00:00
  1. May you please assist me with a PowerShell script that i can use to generate a report on OneDrive to get Microsoft Teams recordings older than 1 year.
  2. May you please assist me with a PowerShell script that i can use to generate a report on exchange mailbox to get emails older than 1 year.
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,895 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,322 questions
Microsoft Exchange
Microsoft Exchange
Microsoft messaging and collaboration software.
688 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce Jing-MSFT 10,310 Reputation points Microsoft External Staff
    2025-02-04T08:42:49.95+00:00

    Hi,@

    For the second question you can refer to the following script:

    # 1. Deadline for calculationv
    $cutoffDate = (Get-Date).AddYears(-1).ToString("yyyy-MM-dd")
    $searchQuery = "received<='$cutoffDate'"
    $mailbox = "user@example.com"
    # 2. Create a new compliance search task
    New-ComplianceSearch -Name "OldEmailsSearch" -ExchangeLocation $mailbox -ContentMatchQuery $searchQuery
    # 3. Start the search task
    Start-ComplianceSearch -Identity “OldEmailsSearch”
    # 4. Export results
    New-ComplianceSearchAction -SearchName "OldEmailsSearch" -Export -Format FxStream
    
    1 person found this answer helpful.
    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.