HighTechTalks DotNet Forums  

Audit Rules

Dotnet Security microsoft.public.dotnet.security


Discuss Audit Rules in the Dotnet Security forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
dan artuso
 
Posts: n/a

Default Audit Rules - 12-04-2007 , 02:22 PM






Hello,
I'm trying to get all audit rules for one file like so:

Dim fi As New FileInfo("C:\HostMonitorLog.txt")

Dim fs As New FileSecurity

Dim typeToGet As Type

fs = fi.GetAccessControl()

typeToGet = Type.GetType("System.Security.Principal.NTAccount" )

For Each rule As FileSystemAuditRule In fs.GetAuditRules(True, True,
typeToGet)

Debug.Print(rule.IdentityReference.Value)

Next

However GetAuditRules is returning an empty collection. What am I missing?
I do have auditing enabled via my local security policy and I am admin on
the box.

Thanks,
Dan





Reply With Quote
  #2  
Old   
dan artuso
 
Posts: n/a

Default Re: Audit Rules - 12-05-2007 , 02:46 PM






Hi,
In case anyone else runs into this:

fs = fi.GetAccessControl(AccessControlSections.Audit)


Dan


"dan artuso" <dartuso (AT) NOSPAMpagepearls (DOT) com> wrote

Quote:
Hello,
I'm trying to get all audit rules for one file like so:

Dim fi As New FileInfo("C:\HostMonitorLog.txt")

Dim fs As New FileSecurity

Dim typeToGet As Type

fs = fi.GetAccessControl()

typeToGet = Type.GetType("System.Security.Principal.NTAccount" )

For Each rule As FileSystemAuditRule In fs.GetAuditRules(True, True,
typeToGet)

Debug.Print(rule.IdentityReference.Value)

Next

However GetAuditRules is returning an empty collection. What am I missing?
I do have auditing enabled via my local security policy and I am admin on
the box.

Thanks,
Dan







Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.