Find the folders in the document library.Find the document library (for the purpose of this article, we assume the target site has a single document library this is usually the case for most sites today, especially those connected to Teams).It’s always a good idea to run the Disconnect-MgGraph cmdlet beforehand to remove any previous session. Connect to the Microsoft Graph with the correct permissions.Steps to Create a SharePoint Site Files ReportĬonceptually, the steps to create a report listing the files found in a SharePoint Online site are straightforward: In this case, I had a script to decrypt protected SharePoint files by removing sensitivity labels from the files. More importantly, I had some code that I could reuse (rule number 1 of any PowerShell project is to find some code to start off). I chose to use Microsoft Graph API requests instead on the basis that I knew the Graph better than PnP. The PnP PowerShell module includes cmdlets to open folders and list files found there, and I’m sure that you could create a document report with its cmdlets. The SharePoint Online PowerShell module is firmly in this tradition and doesn’t offer any ways to navigate within a site and report what’s found there. Traditionally, PowerShell modules have handled the automation of administrative activities, like generating a list of SharePoint Online sites or Microsoft 365 Groups. But nowhere do I find a simple listing of documents.įigure 1: Storage metrics for a SharePoint Online site Processing SharePoint Site Files with PowerShell Site contents will tell me the total number of files in the document library (and even more in the preservation hold library), and the storage metrics for the site informs me about storage consumption (Figure 1). Microsoft 365 includes SharePoint activity reports and file and folder sharing reports and usage reports. Searches for a feature to do the job found nothing. I wanted to know what documents were in what folders, the size of the documents, and their authors. It’s easy to find out how much storage a site uses through the SharePoint admin center or with PowerShell, but that doesn’t tell us what’s in a site. Over nine editions and countless revisions, we have accumulated a large amount of content in the SharePoint Online site we use. The Office 365 for IT Pros team has been working on our eBook since 2014. Which brings me to my opportunity for learning. Tools like retention policies and labels help by removing items automatically after their retention period lapses, but these are broad-brush blunt mechanisms that deal with every item in the same way rather than on an item’s merits. Few of us have the patience (or time) to review the contents of every folder in a document library to decide what should be retained and what is past its best by date. For instance, SharePoint Online sites are fine repositories for documents and other information, but they can be hard to control in terms of what is in document libraries or know about everything stored in SharePoint site files. Often, I learn when the need arises to do something. Knowing What’s in a Site Document Library is Difficult
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |