Forum Discussion
365CS
Jul 27, 2020Copper Contributor
Script for Teams-Chat backup
Sometimes it is necessary to save the chat history of a Teams-Channel. I wrote a simple script, where you can select the needed Team(s) and outputting the Chat-Content to a html File. If there are an...
BarryGoblon
Dec 04, 2023Iron Contributor
365CS I have some improvements of the script:
# Install-Module -Name SharePointPnPPowerShellOnline
# Set up necessary permissions
$SecurityScope = @("Group.Read.All")
Connect-PnPOnline -Scopes $SecurityScope
$PnPGraphAccessToken = Get-PnPGraphAccessToken
# Update the headers with valid scopes
$Headers = @{
"Content-Type" = "application/json"
Authorization = "Bearer $PnPGraphAccessToken"
"scope" = "https://graph.microsoft.com/.default"
}
Rest of your script you can leave unchanged. If you're looking for a smoother backup experience, consider trying NAKIVO. It's user-friendly and reliable for your backup needs.