@@ -12,11 +12,12 @@ migrations, least‑privilege reviews, and security assessments.
1212## 🔥 Key Features
1313
1414- ** Folder-only auditing** (ignores files for speed & clarity)
15- - ** Depth control via ` MaxDepth ` **
15+ - ** Depth control via ` MaxDepth ` parameter**
16+ - Omit parameter or use empty string = unlimited depth\
1617 - ` 0 ` = root folder only\
1718 - ` 1 ` = root + children\
1819 - ` 2 ` = root + children + grandchildren\
19- - * (Press ENTER at prompt to scan unlimited depth) *
20+ - Any positive integer for specific depth limit
2021- ** Streaming CSV output** (no large memory usage)
2122- ** NTFS ACL collection** including:
2223 - Identity (user/group)
@@ -70,25 +71,48 @@ A folder with 10 AD groups = 10 rows in the CSV.
7071
7172## 🚀 How to Use
7273
73- ### ** Basic Example**
74+ ### ** Interactive Mode (Recommended for First-Time Users)**
75+
76+ Simply run the script without parameters:
77+
78+ ``` powershell
79+ .\FolderAclAudit.ps1
80+ ```
81+
82+ The script will prompt you for:
83+ 1 . ** Root Path** - The folder path to audit (required)
84+ 2 . ** Max Depth** - How deep to scan (press ENTER for unlimited)
85+
86+ ### ** Command-Line Mode (All Parameters)**
7487
7588``` powershell
7689.\FolderAclAudit.ps1 -RootPath "\\FS01\TrainingFolder"
7790```
7891
79- When prompted for ** MaxDepth ** , press:
92+ By default, the script scans ** all subfolders ** (unlimited depth) when ` -MaxDepth ` is omitted.
8093
81- - ** ENTER** → unlimited depth\
82- - ** 0** → only the root\
83- - ** 1** → root + children\
84- - ** 2** → root + children + grandchildren\
85- - etc.
94+ ### ** Limited Depth Examples**
95+
96+ ``` powershell
97+ # Scan root folder only
98+ .\FolderAclAudit.ps1 -RootPath "\\FS01\TrainingFolder" -MaxDepth "0"
99+
100+ # Scan root + first level children
101+ .\FolderAclAudit.ps1 -RootPath "\\FS01\TrainingFolder" -MaxDepth "1"
102+
103+ # Scan root + children + grandchildren
104+ .\FolderAclAudit.ps1 -RootPath "\\FS01\TrainingFolder" -MaxDepth "2"
105+
106+ # Explicitly set unlimited depth (same as omitting -MaxDepth)
107+ .\FolderAclAudit.ps1 -RootPath "\\FS01\TrainingFolder" -MaxDepth ""
108+ ```
86109
87110### ** Custom Output Paths**
88111
89112``` powershell
90113.\FolderAclAudit.ps1 `
91114 -RootPath "\\FS01\TrainingFolder" `
115+ -MaxDepth "2" `
92116 -OutputCsvPath "C:\Audit\Training_ACL.csv" `
93117 -LogFilePath "C:\Audit\Training_Log.txt"
94118```
@@ -124,19 +148,19 @@ The script scans:
124148
125149It ** does NOT** scan deeper subfolders.
126150
127- ### ** MaxDepth = Unlimited (ENTER )**
151+ ### ** MaxDepth = Unlimited (Omitted or Empty String )**
128152
129- It scans every folder under the root.
153+ When you omit the ` -MaxDepth ` parameter or pass an empty string ( ` -MaxDepth "" ` ), it scans every folder under the root.
130154
131155------------------------------------------------------------------------
132156
133157## ⚙️ Requirements
134158
135159- Windows 10/11 or Windows Server\
136- - PowerShell 5+ \
160+ - PowerShell 5.1+ (Windows PowerShell) or PowerShell 7+ (PowerShell Core) \
137161- Read access to target folders\
138- - Share-permission retrieval requires remote CIM access if scanning
139- UNC paths
162+ - Share-permission retrieval requires remote CIM access if scanning UNC paths \
163+ - SMB share access for share permission collection
140164
141165------------------------------------------------------------------------
142166
@@ -154,12 +178,13 @@ perms and metadata GUI never shows**.
154178
155179## 📝 Logging & Error Handling
156180
157- - Full transcript written to the log file you specify\
181+ - Full transcript written to the log file you specify (auto-generated if not provided) \
158182- Any unreadable folders produce entries in:\
159- ** ` <csvfilename>.errors.csv ` **
183+ ** ` <csvfilename>.errors.csv ` ** \
184+ - Progress indicators show current folder being processed\
185+ - Summary statistics displayed at completion (total ACE rows, errors encountered)
160186
161- The audit ** never stops** due to permission failures --- it logs and
162- continues.
187+ The audit ** never stops** due to permission failures --- it logs and continues.
163188
164189------------------------------------------------------------------------
165190
@@ -169,9 +194,38 @@ Free to use, modify, and integrate into your environment.
169194
170195------------------------------------------------------------------------
171196
172- If you want a version with: - Effective permissions\
173- - Group nesting expansion\
174- - Risk scoring\
175- - Or HTML/Excel formatted reports
197+ ## 📋 Parameters
198+
199+ | Parameter | Required | Default | Description |
200+ | -----------| ----------| ---------| -------------|
201+ | ` -RootPath ` | Prompted if omitted | - | Root path to audit (UNC or local path) |
202+ | ` -MaxDepth ` | Prompted if omitted | ` "" ` (unlimited) | Maximum folder depth to scan (0 = root only) |
203+ | ` -OutputCsvPath ` | No | Auto-generated | Path to output CSV file |
204+ | ` -LogFilePath ` | No | Auto-generated | Path to log file |
205+
206+ ** Note** : If ` -RootPath ` or ` -MaxDepth ` are not provided, the script will interactively prompt for them.
207+
208+ ## 🔧 Advanced Usage
209+
210+ ### ** Local Path Example**
211+
212+ ``` powershell
213+ .\FolderAclAudit.ps1 -RootPath "C:\Data" -MaxDepth "1"
214+ ```
215+
216+ ### ** DFS Namespace Example**
217+
218+ ``` powershell
219+ .\FolderAclAudit.ps1 -RootPath "\\Domain\DFS\Namespace\Folder" -MaxDepth "3"
220+ ```
221+
222+ The script automatically detects and includes share information when available.
223+
224+ ---
225+
226+ ## 💡 Tips
176227
177- ...I can generate those too.
228+ - For large directory trees, start with ` -MaxDepth "1" ` to test performance\
229+ - Output files are auto-named with timestamps if not specified\
230+ - CSV files use UTF-8 encoding for international character support\
231+ - Error CSV files are created only if errors occur during scanning
0 commit comments