Share via

powershell script to include site collections to lists libraries and items

Shri-6058 326 Reputation points
2021-03-24T17:22:28.78+00:00

Hello, I checked various options and currently the report provides only list and library levels. I want to include the report having site collections until all list items, documents level. Is there a way to include items and all documents in the same report?

Please direct me if there are any available script to generate.

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint Server | Development
Windows for business | Windows Server | User experience | PowerShell

2 answers

Sort by: Most helpful
  1. Shri-6058 326 Reputation points
    2021-04-15T04:13:28.073+00:00

    Thank you for the suggestion. We just want to analyze how old is document or list item and discard if its more than 3 years old. We want to capture each items with lastviewed/modified date. The last link you sent would work if it populates all list and Document library items. Currently it only populates all lists and library name and total count. Is there a way we can add item url to it?

    Was this answer helpful?

    0 comments No comments

  2. Elsie Lu_MSFT 9,806 Reputation points
    2021-03-25T08:55:32.403+00:00

    Hi @Shri-6058 ,

    It is generally not recommended to export all the items and documents of the entire site collection for there may be many items/files in many lists and libraries.

    As you have already known how to get item/document in a list/library, I found some posts for you, you could try to write your script:

    Get All Web Applications in SharePoint using powershell
    Get All Site Collections in a Web Applications using PowerShell
    Get All List and Libraries Inventory of a SharePoint Site Collection using PowerShell


    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.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.