Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement OneDrive shared with me #4062

Open
harryqt opened this issue Mar 12, 2020 · 42 comments
Open

Implement OneDrive shared with me #4062

harryqt opened this issue Mar 12, 2020 · 42 comments

Comments

@harryqt
Copy link
Contributor

harryqt commented Mar 12, 2020

OneDrive has shared with me listing api, like Google Drive --drive-shared-with-me.

There is no way to list shared with me files in OneDrive for Business.

Docs: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_sharedwithme?view=odsp-graph-online

API explorer: https://developer.microsoft.com/en-us/graph/graph-explorer

@ncw
Copy link
Member

ncw commented Mar 15, 2020

This would probably be a relatively easy addition - what do you think @Cnly ?

Do you want to help implement this @Dibbyo456 ?

@ncw ncw added this to the Help Wanted milestone Mar 15, 2020
@Cnly
Copy link
Member

Cnly commented Mar 19, 2020

Capability to list shared files will of course be great and welcome! But AFAIK shared items in OneDrive for Business don't show up in the user's drive root. Does that mean they'll only be accessible when this new flag is supplied?

@ncw
Copy link
Member

ncw commented Mar 20, 2020

But AFAIK shared items in OneDrive for Business don't show up in the user's drive root. Does that mean they'll only be accessible when this new flag is supplied?

That is the way the equivalent --drive-shared-with-me flag works - when you supply it, it only shows shared items. Effectively it is another root for the drive.

@rodrigorrm
Copy link

Hi, hello guys, just for information.. is this feature being constructed? We need it real bad here.

@ncw
Copy link
Member

ncw commented Apr 1, 2020

We are currently looking for a volunteer to implement - maybe that could be you @rodrigorrm
?

@ncw
Copy link
Member

ncw commented May 14, 2021

#2536 (comment)

this works.
for the url just go to the shared folder, copy the url till before "/_layouts/........" and add "/Documents" at the end

That is interesting. The shared folder is probably reachable with microsoft graph too - if it is then you can configure rclone with it.

@Cnly
Copy link
Member

Cnly commented Jun 19, 2021

That is interesting. The shared folder is probably reachable with microsoft graph too - if it is then you can configure rclone with it.

I don't have an idea how to use that URL for graph. Isn't that supposed to be used for WebDAV?

@pcantalupo
Copy link

Any movement on this issue? I'm being forced off Box (to OneDrive) at my workplace where I have automation scripts to copy files to and from Box seamlessly. I need to copy to/from OneDrive Shared folders using rclone the same way I did with Box. Any help or suggestions are appreciated. Thank you

@nafets227
Copy link

I configure the shared directories to be included in "my OneDrive" and then clone finds it. Drawback of this is, that it required write permissions.

@ncw
Copy link
Member

ncw commented Jun 27, 2022

@pcantalupo we are looking for volunteers to add this if you'd like to help?

@pcantalupo
Copy link

@nafets227 can you elaborate how you did this with code and command line examples? or point me to the documentation on this? Thank you

@pcantalupo
Copy link

@ncw Thank you but I'm not a coder, just a happy and thankful user of rclone.

@nafets227
Copy link

@pcantalupo you need to go on onedrive.live.com, select the shared folder and then click on "Add to my OneDrive". After that, it will be copied by clone.

image

@pcantalupo
Copy link

@nafets227 I am using OneDrive through the University that I work for. I do not have an account on onedrive.live.com. When I go to my OneDrive on the web, I do not have the option "Add to my OneDrive"... rather I have the option to "Add shortcut to My Files". Rclone cannot see these "shortcuts" in my root OneDrive directory. That is what this whole #4062 issue is about.

@nafets227
Copy link

Ah then you are probably using OneDrive Business. That's a different implementation :( and I have no experience with it.

@4d30
Copy link

4d30 commented Jul 29, 2022

Ah then you are probably using OneDrive Business. That's a different implementation :( and I have no experience with it.

@nafets227 Does it make sense to add a new storage type? Something like:

26 / Microsoft OneDrive
   \ "onedrive"
27 / Microsoft OneDrive Business
   \ "msodb"

@nafets227
Copy link

If i remember well current rclone is handling both under the same type. But from my pov it would make things more clear to separate it.

@4d30
Copy link

4d30 commented Aug 12, 2022

If anyone needs a fix today, here's a link to software which can sync MS OneDrive Business shared folders . Can confirm.
https://github.com/abraunegg/onedrive/

@vanplus
Copy link
Contributor

vanplus commented Dec 7, 2022

You can create shortcut for Shared with me files, then you rclone visit it in 'My files'
image

@ncw
Copy link
Member

ncw commented Dec 7, 2022

@vanplus that is a great workaround. Fancy doing a doc update here? (Click the pencil icon to edit - or send a PR if you prefer).

https://github.com/rclone/rclone/blob/master/docs/content/onedrive.md

@vanplus
Copy link
Contributor

vanplus commented Dec 7, 2022

@ncw Thanks, PR #6610

@Anafabula
Copy link

@vanplus That has been discussed before and doesn't work with OneDrive Business (just tested again with rclone 1.60.1), which is what this issue is about.

@4d30
Copy link

4d30 commented Dec 8, 2022

@ncw Thanks, PR #6610

Would be useful to indicate in the docs that this method does not work for OneDrive Business

@reinierpost
Copy link

I just tried this with OneDrive Business (or whatever it's called now) and after using the feature Add shortcut to My Files I can indeed copy files to the directory another user shared with me with rclone copy, and list its contents with rclone lsd and lsl. I am using rclone v1.50.4 on Ubuntu 18.04.

Quirks (there may be more):

  1. rclone does not include the shared directory in the output of rclone lsd, but copying to it with rclone copy and listing its contents do work.
  2. Another quirk: after copying a file, rclone deletefile would not delete it, claiming it didn't exist, even though lsl listed it and it was definitely there. I had to use the OneDrive web interface to delete it.

@4d30
Copy link

4d30 commented Dec 19, 2022

2022-12-20-043851_579x518_scrot

@reinierpost Cannot confirm :(

As you can see there are two linked directories and a text file named 'mwe.txt' in the web-browser view, but when rclone is used to list the objects in the directory: the two linked directories cannot be found.

@Anafabula
Copy link

@reinierpost Can confirm, that's interesting
image
Unfortunately it doesn't seem to work for mounts.
image

@ztevo
Copy link

ztevo commented Feb 13, 2023

You can create shortcut for Shared with me files, then you rclone visit it in 'My files' image

Hi all
Just to add - I found the workaround described above, has a limitation whereby you can only create such a shortcut when the files/folders have been shared with write / edit access (i.e. it is seemingly not possible to create a shortcut for files/folders that have been shared as read / view only).
As such, direct access to the "Shared with you" folder would still be necessary feature for read only files.
Thanks for the great work.
Stevo

@nh4ttruong
Copy link

nh4ttruong commented Jun 26, 2023

It seems to only show "Shortcut" folder when rclone lsd test:abc_shortcut with name and "Shortcut" is not listed with rclone lsd test:

rclone lsd test:abc_shortcut
          -1 2023-05-30 11:25:30         4 PROD
          -1 2023-03-22 14:02:26         3 STG

So, I only see or read/write on abc_shortcut with rsynce sync /path/sync test:abc_shortcut. It's so complicated -.-

@SDS1234
Copy link

SDS1234 commented Nov 2, 2023

I can't setup an shortcut...
Still working on the feature?

@numb95
Copy link

numb95 commented Nov 30, 2023

Same here. The shortcut doesn't show in the Onedrive UI for me. I also have to mention that I'm not using the business subscription.

@shirou93
Copy link

Same. Shortcut not showing on personal onedrive.

@mentionmenot
Copy link

Same boat to me. There are no "Add shorcut to my files" anymore. It seems come from Microsoft side because I tried OneDrive app on iOS and got an error when adding shortcut from shared folder.

@rmast
Copy link

rmast commented Feb 3, 2024

Yes, the option/workaround is not available nowadays for OneDrive personal.
I went to https://developer.microsoft.com/en-us/graph/graph-explorer to watch the differences between the output of the endpoints
https://graph.microsoft.com/v1.0/me/drive/root/children
and
https://graph.microsoft.com/v1.0/me/drive/sharedWithMe
It appears the json-stucture slightly differs, might be related to the type microsoft.graph.driveItem, so just replacing me/drive(s) with sharedWithMe would't be sufficient. This type of data should be interpreted by rclone onedrive:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
    "value": [
        {
            "@odata.type": "#microsoft.graph.driveItem",

@TariqMK
Copy link

TariqMK commented Feb 28, 2024

The option to add a shared folder to 'My Files' is still there for me when signing in via the web:
image

@gizagiant
Copy link

gizagiant commented Mar 7, 2024

At least in my case, testing on debian linux v1.60.1-DEV and OneDrive for Business
As prerequisites, you need to have a shared folder with write access and add a shortcut to your drive.

rclone ls onedrive_business: => does not list shared folders
rclone ls onedrive_business:shared_folder => DOES list shared folders
rclone copy file.txt onedrive_business:shared_folder => DOES copy file to shared folder

@edc-w edc-w removed the new feature label Jun 17, 2024
@Simon818
Copy link

Simon818 commented Jul 5, 2024

OneDrive is in a crisis right now. What I'm about to describe is not unique to me; there are forum posts everywhere about it.

At some point in the last two months, the functionality of the "Add Shortcut to My Files" option started creating actual web shortcuts (.url files) instead of essentially symlinking the folder. Then, a few weeks ago, existing oneDrive shared folders started being unceremoniously deleted from people's computers and replaced with the same .url files.

All this to say ... I would give a lot for rclone to have a "shared with me" option. I've tried downloading from the web interface of OneDrive but it is a mess. I can't get files to copy without "something went w4rong" errors on every file. I can download zips of batches of files as long as they don't go over 20 GB, but the interface won't actually show me the size of all items selecetd. And of course rclone no longer shows the folder shortcuts either. They're just gone.

I don't know if this has been looked at lately but this would be a really good time. I wish I had the coding skills necessary to hack something together but I really don't. Rclone might become one of the only things capable of accessing shared folders in a sane way.

@ztevo
Copy link

ztevo commented Aug 2, 2024

OneDrive is in a crisis right now. What I'm about to describe is not unique to me; there are forum posts everywhere about it.

At some point in the last two months, the functionality of the "Add Shortcut to My Files" option started creating actual web shortcuts (.url files) instead of essentially symlinking the folder. Then, a few weeks ago, existing oneDrive shared folders started being unceremoniously deleted from people's computers and replaced with the same .url files.

All this to say ... I would give a lot for rclone to have a "shared with me" option. I've tried downloading from the web interface of OneDrive but it is a mess. I can't get files to copy without "something went w4rong" errors on every file. I can download zips of batches of files as long as they don't go over 20 GB, but the interface won't actually show me the size of all items selecetd. And of course rclone no longer shows the folder shortcuts either. They're just gone.

I don't know if this has been looked at lately but this would be a really good time. I wish I had the coding skills necessary to hack something together but I really don't. Rclone might become one of the only things capable of accessing shared folders in a sane way.

This has caused me some issues too.

Key references:

https://answers.microsoft.com/en-us/msoffice/forum/all/mac-onedrive-app-shared-folders-dont-appear-in/a9e0ef94-63a6-4522-94a2-9cac9fffd111

https://support.microsoft.com/en-gb/office/add-and-sync-shared-folders-to-onedrive-for-home-8a63cd47-1526-4cd8-bd09-ee3f9bfc1504#bkmk_shortcuts

@shawncook
Copy link

I needed to fetch files from a shared Sharepoint drive and had some difficulty configuring rclone, but figured it out in the end. I'll list my steps here in case others find themselves here too.

  1. Create the shortcut in OneDrive
    From the web view for the items shared with you, right click the folder you need and choose Add shortcut to OneDrive. A shortcut to that file will be created in your personal account.

  2. Configure rclone remote
    In rclone.conf, I have the following block:

    [mysp]
    type = onedrive
    token = <my encrypted password> # generated during `rclone config`
    drive_id = <my drive id>
    drive_type = business
    

    Your drive ID can be found in the Graph Explorer, under OneDrive > list items in my drive. If you run the provided query, your driveId should appear in the response.

  3. Check that it works
    I'll second this comment: Implement OneDrive shared with me #4062 (comment)

    Once you've created shortcuts to shared files, they still don't seem to appear when you run rclone ls mysp: on the root directory. However, they can be accessed by listing the shared directory directly.

    For example, if your shared folder is named My Dir, running rclone ls mysp: does not display My Dir or its contents.

    However, running rclone ls "mysp:My Dir" correctly displays the shared folder's contents.

@Simon818
Copy link

Simon818 commented Oct 3, 2024

Wow, you're right. Thank you!

I'm part of someone else's shared folder called "hard drive", and right now it shows up as a file called "hard drive.url" on Windows. However, if I do something like

rclone mount "onedrive:hard drive"

Rclone will actually list the directory and allow me to interact with it. Curiouser and curiouser.

@Seeker220
Copy link

Seeker220 commented Dec 5, 2024

@shawncook Thanks Man! You saved my day :). In my case, I created shortcut of a shared folder in root folder, and rclone lsd root: or rclone ls root: doesn't even show the shared folder (not even shared folder.url). But when I did rclone ls root:\shared folder , it worked like magic. :)

@Seeker220
Copy link

Seeker220 commented Dec 5, 2024

@shawncook I also found how to do this in onedrive web interface alone.
If you go to shared then right click on the shared folder, the copy to option won't appear. BUT if you left click it and then go back, it appears. For details, see this video!
You can even copy it to a shared folder (if you have access), in that case, you have to either create shortcut of destination shared folder in your onedrive, or add the destination shared folder to favourites

@Publish3r
Copy link

Since one or two days the Onedrive Shared Folders are disappeared and not showed anymore. Can you fix it, please? Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests