How to list CACLS (rights) for a folder and log to disk

168 views Asked by At

What I want to know is how can I write the CACL rights of a folder recursively (folders and files) out to disk. I want to write two different folders out and compare them using two output files in a tool like winmerge. I have a website that works when it's setup using some manual steps but then when I publish from the build server something gets set with the CACLS automatically and the site get's access denied again when you try to browse to it. I know the TFS build server is doing something when it publishes but I am trying to figure out what is different after it publishes. I made a backup of the good folder that works, so I need to output the CACL's, etc of each folder and do a text compare. I already went through by eye and checked all the folders and files with the file properties viewer and looked for missing files or altered web.configs. It's not that. I have looked all over google and can't find a very good solution. Can someone help me?

1

There are 1 answers

0
MvdD On

From PowerShell you could run something like this:

gci -Recurse *.* | % {cacls $_} > c:\temp\cacls.txt

That should give you something you can compare in a diff tool.