You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/spo-time-based-file-reports/README.md
+290-8Lines changed: 290 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,18 +22,22 @@ The three scripts are as follows:
22
22
- Scan the specific folders in the specific libraries on the specific sites from the csv file to get files older than 4 years
23
23
- Create a report with the specific name in the csv file and upload it to the specified SharePoint location
24
24
25
-
## Pre-requisites
25
+
## Pre-requisites
26
+
26
27
Several things must be configured or installed ahead of time
27
-
An App registration with a certificate and appropriate permissions has to be created in Azure
28
-
That certificate must be installed on any machine that will run the scripts
29
-
PowerShell 7 must be installed
30
-
The following PowerShell modules are needed:
31
-
PnP.PowerShell
32
-
ImportExcel
28
+
- An App registration with a certificate and appropriate permissions has to be created in Azure
29
+
- That certificate must be installed on any machine that will run the scripts
30
+
- PowerShell 7 must be installed
31
+
- The following PowerShell modules are needed:
32
+
- PnP.PowerShell
33
+
- ImportExcel
34
+
33
35
## Setup
36
+
34
37
Each of these scripts runs off of a csv file that you must fill out before running. You also have to configure the scripts themselves. See below for more details.
35
38
36
39
### All Scripts
40
+
37
41
This script uses an Azure App registration for authentication. You must create the registration with certificate to get the client ID, tenantID, and certificate thumbprint. You should also make sure that app has sufficient permissions. These are the ones I used:
38
42
39
43

@@ -58,6 +62,7 @@ Fill out the OneDriveURLs.CSV file with the URL of the OneDrive user you wish to
58
62
Fill out the Script2SPURLs.csv file with the URLs for all the SharePoint sites you wish to scan. Make sure you use the complete path!
59
63
60
64
### Single document library and folder
65
+
61
66
1. Open customSPURLs.csv
62
67
2. Add the URL for every site you wish to scan
63
68
3. Add the library name for the title of the library you are scanning
@@ -77,10 +82,10 @@ Now that the scripts are setup, you just need to run them. All these steps are t
77
82
4. Hit enter and the script will run
78
83
5. Do the same thing with script 2 and 3 if you wish
79
84
80
-
81
85
## 1. OneDrive Scan
82
86
83
87
# [PnP PowerShell](#tab/pnpps)
88
+
84
89
```powershell
85
90
86
91
# Declare and initialize your app-only authentication details
@@ -259,6 +264,7 @@ Stop-Transcript
259
264
## 3. Individual library and folder Scan
260
265
261
266
# [PnP PowerShell](#tab/pnpps3)
267
+
262
268
```powershell
263
269
# Declare and initialize your app-only authentication details
264
270
$clientId = "xxxxx"
@@ -334,11 +340,287 @@ Stop-Transcript
334
340
[!INCLUDE [More about PnP PowerShell](../../docfx/includes/MORE-PNPPS.md)]
0 commit comments