pnp / cli-microsoft365

Manage Microsoft 365 and SharePoint Framework projects on any platform
https://aka.ms/cli-m365
MIT License
909 stars 318 forks source link

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

Open rabwill opened 3 years ago

rabwill commented 3 years ago

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