how to get advanced statistics on the use of documents in a library in sharepoint online with powershell

Fanny JACQUET 21 Reputation points

Hello community !

It's all in the title :-)

I'm trying to retrieve advanced stats of document usage in a data library (in SPO) with powershell.

Can you help me please?

Very thanks.

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,211 questions
0 comments No comments
{count} votes

Accepted answer
  1. Elsie Lu_MSFT 9,791 Reputation points

    Hi @Fanny JACQUET ,

    Per my understanding, you could try to the built-in feature: Audit log reports.

    You can use the audit log reports provided with SharePoint to view the data in the audit logs for a site collection. You can sort, filter, and analyze this data to determine who has done what with sites, lists, libraries, content types, list items, and library files in the site collection.


    Go to Site settings->Site Collection Administration->audit log reports->click “Run a custom report”->set the save location, and and restrict the report to the library, and set the date range.
    And do some settings as you want:

    In the exported data, filter out the library you want.

    Similar posts:
    Any reports available on Document Library usage
    SharePoint metric for Document library : SharePoint Online


    Go to the M365 Admin center>Complicance>Audit, select the library or file and user,time to export the data:

    To go to M365 admin center, you could first go to,then click:

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Fanny JACQUET 21 Reputation points

    Hi @Elsie Lu_MSFT

    Very thanks for your response.

    But I don't have "Custom Reports" in my Audit Log report

    Thanks and have a good day75371-2021-03-08-09h08-54.png

  2. Fanny JACQUET 21 Reputation points

    Hello @Elsie Lu_MSFT

    Thanks for your help but my client wanted a script to analyse the audits.

    Thanks for your help.