martincho
martincho

Reputation: 4717

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.

Upvotes: 0

Views: 429

Answers (1)

Mark Alicz
Mark Alicz

Reputation: 387

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

Upvotes: 1

Related Questions