Skip to content

marcoscheel/M365.TeamsBackup

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 

M365.TeamsBackup

Check out my blog posts regarding the tool:

Usage

Add the account to all teams to backup. Ensure he has access to all private channels or private channels will not be backedup

Run executable with parameter for the environment "--environment Production"

Configuration

Azure AD App registration

I tested the setup as a Global Administrator and you should also use a Global Admin to setup.

You can setup the application via the includes scripts:

  • Using Azure AD PowerShell module (manuel admin consent)
    • .\deploy\create-aadapp.ps1
    • Change the name of the app to your liking ($appName)
  • Using Azure CLI (including admin consent)
    • .\deploy\create-aadapp-cli.ps1
    • Change the name of the app to your liking ($appName)

Or for a manuel setup through the Azure portal:

  • Name: e.g. dev-GKMM-msteamsbackup-app
  • Supported account types: My organization only
  • Authentication
    • Add mobile and desktop
    • Advanced Settings
      • Allow public client flows: Yes
  • API Permission
    • MS Graph
      • Delegate
        • Channel.ReadBasic.All
        • ChannelMember.Read.All
        • ChannelMessage.Read.All
        • ChannelSettings.Read.All
        • Group.Read.All
        • GroupMember.Read.All
        • Team.ReadBasic.All
        • TeamMember.Read.All
        • TeamSettings.Read.All
        • TeamsTab.Read.All
    • Grant admion consent for ORG

BackupToHtmlConsole

appsettings(.Development|.Production).json

  • M365
  • AzureAd
  • Backup
    • Path: Output directory for the JSON files
    • JsonWriteIndented: Use pretty (easy to read) JSON with formating. Setting to "false" will save some space.
    • TeamId: Optional. If filled only this team will be used for backup

BackupConsole

appsettings.(Development|Production).json

  • M365
    • Html
      • SourcePath: Location of the JSON files
      • TargetPath: Location the HTMLs will be saved to
      • TemplateFile: Html templated loaded for every html file. Allows styling (css) of the content
      • UseInlineImages: Create a single HTML file and all images are BASE64 encoded. Note: Html will be very large!
      • CreateSingleHtmlForMessage: In addition to the channel.html file every thread will also be saved as a HTML message. Could be a benefit for SharePoint search, display in SPO and smaller files in general.