We help IT Professionals succeed at work.

need script to query ntfs permissions of folders at a defined directory depth

hakalugi
hakalugi asked
on
looking for a vbs script that would, upon execution, prompt the user for an integer, that value would determine the # of folder/directory levels to recurse, and all folders at that level (relative to the locaion of the script's location) would have their ntfs file permissions noted.

the goal is to quickly provide an output to file that records all of the permisisons for a set of folders X levels deep.    if the variable depth recusion is too complex, then a fixed dept of 1 level (ie: run it in \\server\shares\users and get the ntfs permissions for all subfolrders at: \\server\shares\users\<here>

Comment
Watch Question

Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
Try another approach; for a comprehensive output of NTFS permissions, DumpSec (http://www.systemtools.com/somarsoft) is my favorite tool.
Install the download on an XP machine, uncheck "Hyena"; you can then copy DumpSec.exe and the help file to where you want.
You'll get the most concise report possible when you go to Report > Permission Reports Options, check only "Show Permissions", and set the radio button to "Show directories (but not files) whose permissions differ ...". (Showing the owner will create a lot of entries nobody actually cares about when all you want is an NTFS permission report, and file permissions usually aren't that interesting, either.)
The generated report can then be saved for example as a tab-separated text file, with the path in the first field.
If you still need only a certain folder level even if inherited permissions are suppressed, it should be rather easy to use a script to filter out the folder depth by counting the backslashes in the path.

Author

Commented:
that'll work, thanks.