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
{{ message }}
Repository navigation
Commit ba12cee
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: scripts/spo-hide-list-from-site-contents/README.md
+68-8Lines changed: 68 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
# Hide SPO List using PnP PowerShell
1
+
# Hide SharePoint list from Site Contents
2
2
3
3
## Summary
4
4
5
-
This PowerShell script automates the process of hiding a SharePoint Online list and generating an audit record of the administrative action.
5
+
These scripts hide a SharePoint Online list from Site Contents using PnP PowerShell or CLI for Microsoft 365. The updated PnP PowerShell version also generates an audit record of the administrative action.
6
6
7
-
It uses PnP PowerShell with certificate-based application authentication to connect to a specified SharePoint Online site, sets the target list's Hidden property to $true, and exports an audit record containing the action date, executing user, site URL, list name, and action performed.
7
+
The updated version uses PnP PowerShell with certificate-based application authentication to connect to a specified SharePoint Online site, sets the target list's Hidden property to $true, and exports an audit record containing the action date, executing user, site URL, list name, and action performed.
8
8
9
9
The generated CSV report provides a lightweight, timestamped record suitable for operational auditing and change tracking.
10
10
@@ -21,8 +21,13 @@ This script provides a repeatable approach to:
21
21
- Record who performed the action and when it occurred.
22
22
- Produce a timestamped audit file for operational records or change management.
[!INCLUDE [More about PnP PowerShell](../../docfx/includes/MORE-PNPPS.md)]
127
+
123
128
## Output
124
129
125
-
A timestamped CSV file is created in the configured output directory:
130
+
The updated PnP PowerShell version creates a timestamped CSV file in the configured output directory:
126
131
127
132
> SharePointListAudit_yyyyMMdd_HHmmss.csv
128
133
@@ -150,7 +155,7 @@ Example record:
150
155
151
156
## Refactoring Notes
152
157
153
-
The original script was refactored from using the **CLI for Microsoft 365 (m365)** to using the **PnP PowerShell module (PnP.PowerShell)** with **certificate-based app-only authentication**.
158
+
The updated version adds an alternative using the **PnP PowerShell module (PnP.PowerShell)** with **certificate-based app-only authentication**. The original PnP PowerShell and CLI for Microsoft 365 scripts remain available in their own tabs.
154
159
155
160
The refactoring also introduces explicit configuration variables, execution metadata, output/audit reporting, structured sections, and clearer operational feedback.
156
161
@@ -171,6 +176,60 @@ The refactoring also introduces explicit configuration variables, execution meta
171
176
|`User feedback`| Minimal | Success message plus audit-file location | Makes execution outcome clearer |
0 commit comments