Help with share report

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:


Or for longer, use three backticks above and below the code snippet:


Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 20.0.4
Operating system and version (eg, Ubuntu 20.04): CentOS 7.7
Apache or nginx version (eg, Apache 2.4.25): nginx 1.18
PHP version (eg, 7.4): 7.4

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. not applicable
  2. not applicable
  3. not applicable

The output of your Nextcloud log in Admin > Logging:

not needed

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

not needed

The output of your Apache/nginx/system log in /var/log/____:

not needed

Dear all,
I’m managing a nextcloud server. I need a way to get a report of all shares of all users. I’ve used this command which works: ./occ sharing list. BTW It contains informations not so readable. I.e. the users are from AD and the output of the syntax is, i.e.

        "id": "2915",
        "file_id": 860670,
        "owner": "64fe674c-18d2-11e8-9e22-000056102fa4",
        "initiator": "64fe674c-18d2-11e8-9e22-000056102fa4",
        "time": "2020-03-15T17:03:03+00:00",
        "permissions": 15,
        "path": "\/MY_PATH",
        "name": "MY_PATH",
        "is_directory": true,
        "type": "user",
        "recipient": "8ccd5210-18d2-11e8-9629-005056102fa4"

So the above does’nt give me informations about the owners and the file/folder.
I’ve tested the apis as well, but the syntax to get, i.e. the share_id 2915 answers me always with the share of the user I’m using to authenticate with the api, even if the user is an administrator.

curl -u 'myuser:mypass' -X GET https://MYSERVER/ocs/v1.php/apps/files_sharing/api/v1/shares?share_id=2915 -H "OCS-APIRequest: true"


<?xml version="1.0"?>

As you can see, the output is referred to id 1518 and not the asked 2915. Changing the id doesn’t help, alwats same result.

Any help??


1 Like

No suggestions at all?

Hi all again. Please even some hints would be helpful. I cannot find out the above informations.

Hello @xefil hope you are doing well…

First of all, why don’t you use “sAMAccountName” as the identification of the username/home dir? This makes your server structure and logs much easier to read.

Second thing, can you please describe your doubt again? It was not clear for me what you need.

All the best, have a nice week!


Hello @Beltran1337 , thanks for your answer.
Well, the system was inherited, so the setup was not done by me. That would be a good choise, but would avoid to change now with many users active.

My needs is to have an export/list of all shares created by users and look those (files or folders) shares to which users and /or groups are shared. Using ./occ sharing list I was able to export the whole shares, but they are not clean readable. You can see the owner, initiator and recipient are values not related to users (i.e. 64fe674c-18d2-11e8-9e22-000056102fa4).

I need to identify / map those numbers to users.

Meanwhile I’ve tested the API as well, but cannot query (look on my curl) based on share_id taken from the previous export. The answer is always the same share, even changing the id.

Maybe I need to query directly the database?



1 Like

Hey man, ok now I understand your issue.

And that’s happening because your ldap server is configured to use the UUID of the user (which is that long number) instead of they’re username.

That’s why I told you to set “sAMAccountName” as the ID.

Like this:

But one thing I have noticed, the occ sharing list does not exist.

PS.: I’m using NC 21.0.1 but I could’t find anything related to that command online, are you sure that’s right?

Hello @Beltran1337 .
It’s an app: Share Listing - Apps - App Store - Nextcloud
BTW if you have better suggestions, let me know.
In case if MySQL queries are needed, ok, then I’ll follow that way.

About the SMAccountName I’ve no idea if that would corrupt what actually is in production. I would avoid to change it. It’s sufficient to have a way to find out those informations if/when needed.

Thanks for the help!

1 Like

Hi @Beltran1337 , sorry, any succestion? :slight_smile:

1 Like

Hello man, hope you are doing well…

Sorry bro, I wish I could help more :stuck_out_tongue:

Don’t worry, thanks anyway! :wink: