简体   繁体   中英

Traverse Windows directory tree and retrieve permissions for each folder

I need a program that will traverse a given directory tree on Windows 2003 Server (or compatible) and return Groups and Users that have access to each folder. I also need the exact permissions for each user that has access to the folder. The output should be a text file containing any usable format, csv, json or xml, etc.

If such a program is not freely available, I need a direction on what Windows functions to use to retrieve security information. I'm on Visual Studio 2012 and I already have the algorithm to traverse a tree structure. I need to know how to retrieve security information from a folder.

Try the link below. It doesn't export it to a csv file, although you could modify the bat file to do so.

http://www.windowsitpro.com/article/tips/jsi-tip-0596-how-do-i-print-the-permissions-on-a-directory-tree-

I just tried it and the output looks like this

i:\MyDirectory\SomeDirectory BUILTIN\Administrators:F 
                         BUILTIN\Administrators:(OI)(CI)(IO)F 
                         NT AUTHORITY\SYSTEM:F 
                         NT AUTHORITY\SYSTEM:(OI)(CI)(IO)F 
                         NT AUTHORITY\Authenticated Users:C 
                         NT AUTHORITY\Authenticated Users:(OI)(CI)(IO)C 
                         BUILTIN\Users:R 
                         BUILTIN\Users:(OI)(CI)(IO)(special access:)

                                                   GENERIC_READ
                                                   GENERIC_EXECUTE

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM