The way to get the information you want is to use Windows Security Auditing, especially. because you want to know who made the change, not just what has changed.
The following code (and settings) produces the following output:
11-07-2011 17:43:10: "Fujitsu \ Grynn" changed the security descriptor in the file "C: \ Users \ Grynn \ Documents \ ExcelTools \ test.txt"
"D: AI (A ;; 0x1200a9 ;;; BU) (A; ID; FA ;;; S-1-5-21-559386011-2179397067-1987725642-1000) (A; ID; FA ;;; SY) (A; ID; FA ;;; BA) '
to
"D: ARAI (A; ID; FA ;;; S-1-5-21-559386011-2179397067-1987725642-1000) (A; ID; FA ;;; SY) (A; ID; FA ;;; B .BUT. ) '
using 'C: \ Windows \ explorer.exe'
12-07-2011 17:55:10: "Fujitsu \ Grynn" changed the security descriptor to the file "C: \ Users \ Grynn \ Documents \ ExcelTools \ test.txt"
"D: AI (A; ID; FA ;;; S-1-5-21-559386011-2179397067-1987725642-1000) (A; ID; FA ;;; SY) (A; ID; FA ;;; B .BUT. ) '
to
"D: ARAI (D ;; FA ;;; S-1-5-21-559386011-2179397067-1987725642-1001) (A; ID; FA ;;; S-1-5-21-559386011-2179397067-1987725642 -1000) (A; ID; FA ;;; SY) (A; ID; FA ;;; BA) '
using 'C: \ Windows \ explorer.exe'
Enabling auditing has 2 steps:
1. Use gpedit.msc to enable "Access Audit Object" 
2. Change the "Audit" for the folder that you want to view 
Now, whenever a file system change event (or via polling) occurs, request a security event log.
Code for querying the security event log:
var props = new EventLogPropertySelector(new string[] { "Event/System/TimeCreated/@SystemTime", "Event/EventData/Data[@Name='SubjectDomainName']", "Event/EventData/Data[@Name='SubjectUserName']", "Event/EventData/Data[@Name='ObjectName']", "Event/EventData/Data[@Name='OldSd']", "Event/EventData/Data[@Name='NewSd']", "Event/EventData/Data[@Name='ProcessName']" }); using (var session = new System.Diagnostics.Eventing.Reader.EventLogSession()) { //4670 == Permissions on an object were changed var q = new EventLogQuery("Security", PathType.LogName, "*[System[(EventID=4670)]]"); q.Session = session; EventLogReader rdr = new EventLogReader(q); for (EventRecord eventInstance = rdr.ReadEvent(); null != eventInstance; eventInstance = rdr.ReadEvent()) { var elr = ((EventLogRecord)eventInstance); Console.WriteLine( "{0}: '{1}\\{2}' changed security descriptor on file '{3}' from \n'{4}' \nto \n'{5}' \nusing '{6}'\n----\n", elr.GetPropertyValues(props).ToArray()); } }
Grynn
source share