pnp / pnp/cli-microsoft365

New command: Export Microsoft Teams messages for the given user or team

Open
#2,073 52 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

keep-open new feature waiting on response work in progress
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

Usage

m365 teams message export [options]

Description

Export Microsoft Teams chat messages for a given user, or a team.

Options
Option Description
--userId [userId] The Id of the user whose messages are to be exported. Specify either userId, userName or teamId
--userName [userName] The UPN of the user whose messages are to be exported. Specify either userId, userName or teamId.
--teamId [teamId] The Id of the team of which the messages are to be exported. Specify either userId, userName or teamId.
--fromDateTime[fromDateTime] The start of time range to query
--toDateTime[toDateTime] The end of time range to query
-l, --licenseModel [licenseModel] License requirements are applicable on the protected Teams export API. Allowed values are modelA, modelB, evaluation. The default is evaluation. Read more about the license requirements.
-a, --withAttachments When specified, the command will also download all chat attachments. Use folderPath as well to set the rootfolder.
-p, --folderPath [folderPath] The folder path to save downloaded attachments to when using withAttachments.
Remarks

Microsoft Teams APIs in Microsoft Graph that access sensitive data are considered protected APIs. Export APIs require that you have additional validation, beyond permissions and consent, before you can use them. To request access to these protected APIs, complete the request form

Additional Information

https://docs.microsoft.com/en-us/microsoftteams/export-teams-content#how-to-access-teams-export-apis

Prerequisites to access this API

https://docs.microsoft.com/en-us/microsoftteams/export-teams-content#prerequisites-to-access-teams-export-apis

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing Teams message command entry points and the Microsoft Graph Teams export API documentation linked in the issue. Done means the command exports messages for a user or team with the date and license options, and optionally downloads attachments to the specified folder.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.