Teams to rclone
powershell script to collect all the drive_ids in sharepoint associated to a team and create a union mount. Read only permissions for creating local backups and/or archives
Why?
Becuase microsoft dont like to make things easy and create sharepoint subsites for private and shared teams channels within a team
Setup
- Create an app in the app registrations section in azure. portal.azure.com > App registrations > New registration (if you dont already have an app)
- Name the app, leave everything as default.
- Once the app has been made make note of the Application (client) ID and Directory (tennant) ID
- Go to Certificates & Secrets > Client secrets and create a new client secret, set the expire and click add
- Once it has been generated make a note of the Value, once you change page that will be stared out and you wont be able to see it again.
- In your config.json set the
tennantId,clientIDandclient secret (Value) - in the remote-template.conf set the
client ID,client secret (value),tennantIDand replace<tenant>with your tenantID - Go to
API permissions > Add a permission > Microsoft Graph > Application permissionsand add the below permissions
Channel.ReadBasic.All
Directory.Read.All
Files.Read.All
Group.Read.All
Sites.Read.All
Team.ReadBasic.All
- Once those have been added go to
Add a permission > Sharepoint > Application permissionsand add the below permission
Sites.Read.All
Usage
- Run the script
- Enter your team name when it asks
- Wait
- Run
rclone lsd --config ./rclone TEAM_NAME_union:when the script is finished to confirm you can see everything - If the team only contains standard channels it will create a config with 1 remote
