Microsoft Teams data has many different locations. And while some locations make it easy to access and export data, others do not. Take Teams Chat History for example. This data lives in a folder of a Group mailbox. This, however, is not a typical mailbox and as such cannot be accessed in a typical way.
How to access and view contents of a GroupMailbox
First run this powershell command to get a list of all GroupMailboxes
Get-mailbox -GroupMailbox | select Displayname, WindowsEmailAddress
Using the WindowsEmailAddress run the following to view the details of the Mailbox folders for the desired Team. You will be able to view the item size of the TeamChat folder from the output.
Get-mailbox -groupmailbox Team@mycompany.com | Get-MailboxFolderStatistics | select Foldertype,ItemsInFolder
How to export TeamChat data to a .pst file
Once you have verified the GroupMailbox and the TeamChat contents with PowerShell you will then need to head over the the Security and Compliance center in your Tenancy. Here we will configure and run a Search to get the contents of the MS Team you wish to export to PST
- In the Security and Compliance Center choose Search and Content Search
- Select Guided Search
- Provide a Name, choose the Teams group as the location and add condition of Type: Equals any of E-mail messages and Instant Messages
- Save and run the query
- Select More from the menu items and choose Export Results
- Choose All items and one PST for each mailbox and export results. Alternatively you can view the results directly from the Content Search or export a results report.
- Once the results have been exported head over to Exports where you will then be able to select the file and download the PST. If you do not see a file select Refresh
- Select the file and choose to Download the results. This will create a PST file that you can then choose to import or open outlook data file using Outlook desktop client and view the results. If you run into an issue running the E-Discovery export tool see this article to troubleshoot – HERE