aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 1251159011f05407c71fc47d30622ba8531619de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Teams to rclone

Python script to collect all the drive_ids in sharepoint associated to a team and create a combine 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

1. Create an app in the app registrations section in azure. portal.azure.com > App registrations > New registration (if you dont already have an app)
2. Name the app, leave everything as default.
3. Once the app has been made make note of the Application (client) ID and Directory (tennant) ID
4. Go to Certificates & Secrets > Client secrets and create a new client secret, set the expire and click add
5. 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.
6. In your config.json set the `tenantId`, `clientID` and `clientSecret` (Value)
7. Go to `API permissions > Add a permission > Microsoft Graph > Application permissions` and add the below permissions

```plain
Channel.ReadBasic.All
Directory.Read.All
Files.Read.All
Group.Read.All
Sites.Read.All
Team.ReadBasic.All
```

8. Once those have been added go to `Add a permission > Sharepoint  > Application permissions` and add the below permission

```plain
Sites.Read.All
```

9. Grant admin consent.

## Flags

```txt
--team-name   [TEAM_NAME ...]
              Team display name prefix(es). Required unless --team-id
--team-id     Team id (skips name lookup). Required unless --team-name
--exact       Exact displayName match
--config      Path to config.json
-o, --outdir  Output directory for .conf files
-h, --help    Show help
```

## Usage

- Make sure you have python 3.7+ and rclone in your PATH
- Run `python3 generate_config.py --team-name "Team One" "Team Two"`
- Wait
- Run `rclone lsd --config ./Team_One.conf Team_One_combine:` when the script is finished to confirm you can see everything