mirror of
https://github.com/rclone/rclone.git
synced 2025-06-22 21:11:37 +02:00
docs: add OneDrive Impersonate instructions - fixes #5610
This commit is contained in:
parent
03bd795221
commit
0d9fe51632
@ -936,6 +936,28 @@ See the [metadata](/docs/#metadata) docs for more info.
|
|||||||
|
|
||||||
{{< rem autogenerated options stop >}}
|
{{< rem autogenerated options stop >}}
|
||||||
|
|
||||||
|
### Impersonate other users as Admin
|
||||||
|
|
||||||
|
Unlike Google Drive and impersonating any domain user via service accounts, OneDrive requires you to authenticate as an admin account, and manually setup a remote per user you wish to impersonate.
|
||||||
|
|
||||||
|
1. In [Microsoft 365 Admin Center](https://admin.microsoft.com), open each user you need to "impersonate" and go to the OneDrive section. There is a heading called "Get access to files", you need to click to create the link, this creates the link of the format `https://{tenant}-my.sharepoint.com/personal/{user_name_domain_tld}/` but also changes the permissions so you your admin user has access.
|
||||||
|
2. Then in powershell run the following commands:
|
||||||
|
```console
|
||||||
|
Install-Module Microsoft.Graph -Scope CurrentUser -Repository PSGallery -Force
|
||||||
|
Import-Module Microsoft.Graph.Files
|
||||||
|
Connect-MgGraph -Scopes "Files.ReadWrite.All"
|
||||||
|
# Follow the steps to allow access to your admin user
|
||||||
|
# Then run this for each user you want to impersonate to get the Drive ID
|
||||||
|
Get-MgUserDefaultDrive -UserId '{emailaddress}'
|
||||||
|
# This will give you output of the format:
|
||||||
|
# Name Id DriveType CreatedDateTime
|
||||||
|
# ---- -- --------- ---------------
|
||||||
|
# OneDrive b!XYZ123 business 14/10/2023 1:00:58 pm
|
||||||
|
|
||||||
|
```
|
||||||
|
3. Then in rclone add a onedrive remote type, and use the `Type in driveID` with the DriveID you got in the previous step. One remote per user. It will then confirm the drive ID, and hopefully give you a message of `Found drive "root" of type "business"` and then include the URL of the format `https://{tenant}-my.sharepoint.com/personal/{user_name_domain_tld}/Documents`
|
||||||
|
|
||||||
|
|
||||||
## Limitations
|
## Limitations
|
||||||
|
|
||||||
If you don't use rclone for 90 days the refresh token will
|
If you don't use rclone for 90 days the refresh token will
|
||||||
|
Loading…
x
Reference in New Issue
Block a user