From 818bde02d890a962fb75837c2fcdc47f8e16f03c Mon Sep 17 00:00:00 2001 From: Nicole Rappe Date: Thu, 11 Jan 2024 20:29:48 -0700 Subject: [PATCH] Add Scripts/Powershell/SMB/Top-Level Permission Report - All Shares.md --- .../SMB/Top-Level Permission Report - All Shares.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Scripts/Powershell/SMB/Top-Level Permission Report - All Shares.md diff --git a/Scripts/Powershell/SMB/Top-Level Permission Report - All Shares.md b/Scripts/Powershell/SMB/Top-Level Permission Report - All Shares.md new file mode 100644 index 0000000..235df04 --- /dev/null +++ b/Scripts/Powershell/SMB/Top-Level Permission Report - All Shares.md @@ -0,0 +1,10 @@ +**Purpose**: +This script will iterate over all network shares hosted by the computer it is running on, and will give *top-level* permissions to all the shared folders. It will not navigate deeper than the top-level in its report. Very I/O friendly. + +``` powershell +$AllShares = Get-SMBShare | Where-Object {$_.Description -NotMatch "Default share|Remote Admin|Remote IPC|Printer Drivers"} | Select-Object -ExpandProperty Name +ForEach ($SMBDirectory in $AllShares) +{ + Get-SMBShareAccess -Name $SMBDirectory | Export-CSV -Path C:\SMB_REPORT.csv -NoTypeInformation -Append +} +``` \ No newline at end of file