Enumerates the directories and files in a given path and produces an Excel report containing users, email addresses, groups, and last modified child date. This information can be useful in determining which folders are being actively used and by whom.
The resulting workbook contains six tabs:
Tab | Description |
---|---|
Item&Detail | This tab provides a detailed relationship between the top-level subdirectory and the users and groups found within that particular folder; and also shows the total size and timestamp for the most recently modified child. |
Users | A unique list of all of the users who have access to one or more of the files within the Path . |
Groups | A unique list of all of the groups who are assigned to one or more of the files and folders within the Path . |
Invalid SIDs | A list of SIDs that represent a disabled user; or a SID that cannot be resolved by the current domain controller (likely indicating a SID from a legacy domain). |
Long Paths | A list of paths containing more than the number of characters specified with LongLength . Defaults to 256. |
Problem Paths | A list of paths that generated an error. This may be due to invalid characters, a long path, or inadequate permissions. See the ErrorMessage column for more detail. |
This script requires the ActiveDirectory, ImportExcel, OZO, OZOFiles, and OZOLogger PowerShell modules. The ActiveDirectory PowerShell module is included with the Remote Server Administration Tools (RSAT) for Windows feature installation. The remaining modules are published to PowerShell Gallery. Ensure your system is configured for this repository then execute the following in an Administrator PowerShell:
Install-Module ImportExcel,OZO,OZOFiles,OZOLogger
This script is published to PowerShell Gallery. Ensure your system is configured for this repository then execute the following in an Administrator PowerShell:
Install-Script ozo-ad-windows-enumerate-directory-users
ozo-ad-windows-enumerate-directory-users
-OutDir <String>
-Path <String>
Parameter | Description |
---|---|
OutDir |
Directory for the Excel report. Defaults to the current directory. |
Path |
The path to inspect. Defaults to the current directory. |
Special thanks to my employer, Sonic Healthcare USA, who supports the growth of my PowerShell skillset and enables me to contribute portions of my work product to the PowerShell community.