This website uses cookies to improve your experience. We'll assume you're ok with this. Know more.

How to Get SharePoint Online Document Library Report

Document libraries in SharePoint Online serve as key features for users to store, organize, and manage files. Users can create multiple document libraries to categorize documents efficiently based on projects, departments, etc. However, managing these libraries poses challenges, making it difficult to locate essential documents quickly. Thus, we help you organize and secure your Microsoft 365 files by listing all document libraries in SharePoint Online.

Native Solution

Microsoft 365 Permission Required


SPO Site owner.

Option 1 Using SharePoint Online

  • Navigate to the desired SharePoint Online site.
  • Select Site contents. Under the Contents section, you can see a list of all SharePoint Online lists and document libraries of the site.
Using SharePoint Online
  • Click on the desired one to get all files available in the document library.

Option 2 Using Windows PowerShell

  • Connect to SharePoint Online PnP PowerShell using the below cmdlet.
  • Windows PowerShell Windows PowerShell
     Connect-PnPOnline -Url <DesiredSite’sURL> -Interactive
  • Run the below cmdlet to get all document libraries in the specified SharePoint Online site using PowerShell.
  • Windows PowerShell Windows PowerShell
     Get-PnPList | Where-Object {$_.BaseType -eq "DocumentLibrary"}
Using Windows PowerShell
  • Gain visibility into both unhidden and hidden document libraries.

Option 3 Using PowerShell Script

  • However, the above cmdlet lacks detailed information on item counts and storage details of document libraries. Therefore, we’ve prepared a PowerShell script that shows the file and folder count, and the storage size of each document library.
  • Download and run the following script in the Administrator PowerShell.
  • Note: You must run the script in PowerShell 7 or a higher version to get the desired results.
Using PowerShell Script
The script meets the following requirements to assist in SharePoint Online document library management:
  • List all document libraries across all SharePoint sites.
  • Get a list of document libraries for a single site.
  • Get all document libraries for multiple sites.
AdminDroid Solution
More than 150 reports are under free edition.

AdminDroid Permission Required

Any user with report access delegated by the Super Admin.

StepsUsing AdminDroid

  • Login to the AdminDroid Office 365 reporter.
  • Navigate to the All Document Libraries report under Reports»SharePoint»Document Libraries.
Using AdminDroid
You can use the Site easy filter to view all document libraries in a specific SharePoint site.
  • With the above chart, you can view the total number of document libraries in each SharePoint Online site collection.

Effortlessly manage document libraries in SharePoint Online!

Ease the challenge of managing files across multiple document libraries! Refine your SharePoint document library management using AdminDroid Microsoft 365 reporting tool.

Witness the report in action using the

SharePoint OnlineList All Document Libraries to Streamline Content Organization in Microsoft 365

Showing 1 of 6

How to create a document library in SharePoint Online?

When you create a SharePoint Online site, a default document library is created which stores all the files shared within the site. You can also create additional document libraries by following the steps below.

Create a New Document Library in SharePoint Online

  • Navigate to the desired SharePoint Online site. Under the Site contents section, click on "+New" and select Document library.
  • Click on Blank library. If you want to use specific templates, you can select the required one from the suggested options.
  • Give the library a name and description (optional) based on its purpose. You can also pick a Microsoft 365 sensitivity label to prevent unauthorized users from accessing the files in the library.
  • If you want to hide this library from the main page, you can uncheck the "Show in site navigation" checkbox (checked by default). Click on Create.

You can then create, upload, and share files in a document library.

Create a Document Library Using PowerShell

  • Connect to SharePoint Online PnP PowerShell using the below cmdlet.
    Connect-PnPOnline -Url <DesiredSite’sURL> -Interactive
  • Run the below cmdlet to create a document library in SharePoint Online using PowerShell.
    New-PnPList -Title "<DocumentLibraryName>" -Template DocumentLibrary -OnQuickLaunch
Create bulk document libraries in SharePoint Online:

Run the PowerShell script below to create multiple document libraries in SharePoint Online.

Connect-PnPOnline -Url <DesiredSite’sURL> -Interactive
newlibraries = @("Library1","Library2", "Library3", "Library4")
foreach ($DocumentLibraryName in $newlibraries) { New-PnPList -Title $DocumentLibraryName -Template DocumentLibrary}

AdminDroid provides a convenient way to check recent document library creations by utilizing the Created column.

  • You can use the sorting feature to quickly locate both recently created and oldest document libraries in SharePoint Online.
  • Handy Hint: Refer to the "Item Count" column to identify the document libraries with the highest number of items. This facilitates the deletion of unwanted files that may contribute to storage issues.

How to upload, create, and delete files in a document library?

You can seamlessly manage document libraries with many items in SharePoint Online. Follow the steps below to create, upload and delete files in a document library.

Create a New File in a Document Library

  • Navigate to the desired SharePoint Online site. Under the Site contents section, select the desired document library in which you want to create files.
  • Select the New option at the top and choose the type of document you wish to create. It can be a Word document, Excel workbook, Link, PowerPoint presentation, etc.

Upload Files to a Document Library

  • Select the Upload option at the top and choose "Files". You can also upload folders or templates to the document library.

Delete Files from a Document Library

  • Click on the ellipses near the file you wish to delete and select "Delete". Now, the file will be moved to the site’s recycle bin.

It is important to note that the size limit of a SharePoint Online document library is 30 million items per library.

However, after reaching a limit of 5000 items, you will be restricted from carrying out certain tasks like adding columns, viewing more than 5000 items in a single view, etc.

What are the types of SharePoint Online document libraries?

Document libraries within a SharePoint site provide a secure platform for storing and organizing files based on your needs. You can create different document libraries to classify files under various categories. It is the best way to display documents in SharePoint Online.

A few types of document library in a SharePoint Online site are,

  • Document Library : This is the most basic format for storing any type of documents in a SharePoint Online site. A default document library will be created when you create a new site, and it will store all the files shared in that site.
  • Site Pages Library : It stores all the pages created in the SharePoint Online site. It is a system-generated library and you cannot upload any pages. However, you can create a new wiki page, web part page, site page, or a link to any other page.
  • Site Assets Library : It is also a system-generated library that stores all the media files used to build the site such as audio & video files, icons, thumbnails, notebooks, etc. Additionally, you can also upload other types of files to it.
  • Style Library : The Style Library is primarily used for storing assets related to branding and customization, such as CSS files, JavaScript files, images, and master pages. It is commonly used to store files that control the visual appearance and behavior of SharePoint sites.

How to give unique permissions to a SharePoint document library?

When you create a document library, it will inherit access permissions from its parent site. However, you may want to control who has access to a document library for restricted access.

Follow the steps below to set permissions for a SharePoint document library:

  • Navigate to the desired SharePoint Online site. Under the Site contents section, select the desired document library for which you want to set unique permissions.
  • Click on the Settings icon and select Library settings»More library settings.
  • Under Permissions and Management, select the "Permissions for this document library" link.
  • Choose the "Stop Inheriting Permissions" option to break permission inheritance from the parent site. Click on Grant Permissions to assign unique permissions.
  • You can then invite users by typing their email addresses and a personal message. Click on SHOW OPTIONS. Here, you have the option to send an email invitation to the desired users.
  • Select a desired permission level for the invited users and click on Share.

If you wish, you can edit permissions for existing users or SharePoint groups using the Edit User Permissions option. Here, you can choose various permission levels like Full Control, Edit, Design, Contribute, Read, etc.

If you prefer to restrict access for current users or SharePoint groups, utilize the Remove User Permissions option to revoke their access.

With AdminDroid’s SharePoint Online document library permissions report, you can easily find all the document libraries with custom permissions.

  • You can use the List Name easy filter to check whether a specific document library is configured with unique permissions or not.
  • Handy Hint: If you find any confidential libraries without unique permissions, you can use the "Set-PnPListPermission" cmdlet to change document library permissions for restricted access.

How to create a custom view of a document library?

SharePoint Online offers customization options for viewing document libraries to suit your preferences. For instance, you can include necessary columns and arrange them in your preferred order, ensuring your document library remains organized for quick reference.

Follow the steps below to create a view in a document library:

  • Navigate to the desired SharePoint Online site. Under the Site contents section, select the desired document library for which you want to create a custom view.
  • Click on the Settings icon and select Library settings»More library settings.
  • Under the Views section, select the "Create view" link. You can choose the desired view type such as Standard, Datasheet, Calendar, and Gantt.
  • Give your view a name and choose the audience. By default, Public View is chosen, allowing anyone on the site to access it. If you wish, you can choose the Personal View option so that only you can use this view.
  • Choose the columns you want to display. You can also set sorting, filtering, and grouping options to align with your specific needs. Configure other settings like row limits, style, and whether to display folders.
  • Click on OK. Now, you can access the created view form the drop-down list present at the top right corner of the document library.

What are the best practices for managing a document library?

Before using document libraries for organizing your files, take note of the following best practices for efficient document management in SharePoint Online.

  • Customize Permissions for a Document Library : Set unique permissions for each document library to ensure that only authorized users can access the files within them.
  • Utilize Metadata in SharePoint Online : Leverage metadata to classify documents based on various attributes such as author, creation date, department, project, etc. This enables more efficient sorting, filtering, and searching of documents within the document library.
  • Enable and Configure Versioning for a Document Library : Implement version control for a document library to track changes and allow for reverting to previous versions as needed. Additionally, delete unwanted versions to manage storage space in SharePoint Online.
  • Add Content Type to a Document Library : Enable and add content types to help define the type of information stored in a document library. You can include necessary fields for each content type to ensure that relevant information is filled out when uploading a document of that type.
  • Setup Alerts on Changes in a Document Library : Create an alert to get notified whenever a file or folder is modified in a SharePoint Online document library.
  • Create Views in a SharePoint Document Library : Create, change, or delete a view of a document library to organize the items based on your preferences.

By following the above document library best practices, you can keep your files organized for easy retrieval of crucial ones.

Additionally, you can also add a document library to a SharePoint page for quick access to important documents.

  • Navigate to the desired SharePoint Online site page. Hover your mouse on the page to locate the + icon mentioned as "Add a new web part in column one" and click on it.
  • Choose Document library from the list of available SharePoint Online web parts and select the desired one.
  • Hit on Republish to display the list of document libraries on a SharePoint page.

AdminDroid SharePoint Online ReporterSimplify document management with insightful SharePoint Online reports!

The AdminDroid SharePoint Online reporting tool allows you to get a detailed report on all document libraries in your Microsoft 365 organization. Additionally, it allows you to audit file access activities within these document libraries to ensure only authorized individuals access them.

AdminDroid excels in providing top-notch features for managing document libraries in SharePoint Online:

AdminDroid’s dedicated section on Document Libraries provides reports on hidden, inactive, and empty libraries in your SharePoint Online environment. It helps ensure that files within document libraries are efficiently utilized, and unnecessary clutter is minimized.

An Overview

Detailed File Access Activities in SPO

Tap into the SharePoint Online file access report to verify that only authorized users are accessing the files in document libraries.

Unified View of Document Libraries in SPO

Delve into the document library dashboard in SharePoint Online to gain insights into various document libraries based on their configurations and activities.

In-Depth Analysis of Folder Activities in SPO

Find who moved a folder to other document library and ensure that sensitive folders are appropriately placed in a library with restricted access.

Granular Insights into SharePoint Online Activities

Inspect the SharePoint Online activity reports to identify any unauthorized actions that may pose a potential threat to the files stored in your document libraries.

Insider's Guide to SharePoint Online External Sharing

Rely on the SharePoint Online external sharing report to identify and prevent accidental sharing of confidential data with external users.

Streamlined Management of SharePoint Online Storage

Utilize the SharePoint Online usage report to mitigate storage issues by managing unused files stored in your document libraries.

AdminDroid empowers you to efficiently manage SharePoint Online by offering comprehensive insights into permissions and files within document libraries. With its advanced reporting features, you can secure your sensitive data and maintain an organized warehouse for your documents.

Kickstart Your Journey with AdminDroid

Your Microsoft 365 Companion with Enormous Reporting Capabilities!

Common Errors and Resolution Steps in getting document libraries in SharePoint Online

The following are the possible errors and troubleshooting hints while dealing with SharePoint Online document libraries.

Error: The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.

This error occurs when you to try to perform certain tasks within a document library that exceeds the view threshold of 5000 items.

Troubleshooting hint :Move files to other document libraries and index the columns to prevent this issue in future.

Error: You don't have permission to add files to this folder so we couldn't upload <FileName>.

This error occurs when you have only the "View" permission in the document library.

Troubleshooting hint :Run the below cmdlet and assign "Edit" or "Full control" permission in SharePoint Online PnP PowerShell.

Set-PnPListPermission -Identity "<DocumentLibraryName>" -User "<UserPrincipalName>>" -AddRole 

Error: Access denied. You do not have permission to perform this action or access this resource.

This error occurs when you try to upload a file or folder to a style library in SharePoint without allowing custom scripts.

Troubleshooting hint :Run the below cmdlet to allow users to use custom scripts in SharePoint Online.

Set-SPOSite <SiteURL> -DenyAddAndCustomizePages $False

Error: Set-PnPListPermission : This operation is not allowed on an object that inherits permissions.

This error occurs when you try to set custom permissions for a document library that inherits permissions from its parent site.

Troubleshooting hint :Run the below cmdlet to stop inhering permissions for a document library.

Set-PnPList -Identity "<DocumentLibraryName>" -BreakRoleInheritance

Error: Set-PnPList : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).

This error occurs when you try to configure settings for a document library without having site admin or owner permissions.

Troubleshooting hint :Ask your Global admin to assign either site owner or admin permissions to you.