Inherited from
Applies to Objects
The IAuditSecurity interface is useful in the management of System Audit Access Control Lists (SACLs) for Windows securable objects such as NTFS files and directories, the registry, and attached printers. You can use methods of the IAuditSecurity interface to get audit information such as audit permissions assigned to various users and groups, and whether auditing is specified for a particular trustee.
Property/Method |
Description |
Initializes File audit security |
|
Initializes Printer object audit security |
|
Initializes Registry Key audit security |
|
Gets the audit permissions for a specified trustee |
|
Gets the (audit) access control list for a trustee |
|
Gets the audit permissions for a trustee. If the trustee is a user, it gets the effective permissions this user gets as a result of being a member of various Groups |
|
Checks if auditing is set for the specified user or group. The permission string specifies the type of auditing to be checked |
|
Sets the audit permissions for a specified trustee |
|
Sets the specified "access failed" audit permission for a specified trustee |
|
Sets the specified "access success" audit permission for a specified trustee |
Remarks
Attach: To use the functionality provided by IAuditSecurity, you
need to first attach the securable object of Windows. This can be
done using the AttachXXXX functions of IAuditSecurity.
Reuse: Once the audit security object is created, you can attach different securable objects to it such as files, directories, registry keys and printers. At a given time, you can have only one securable object attached to an ObjectSecurity object.
Example
'To initialize the file audit security
Dim auditSec As IAuditSecurity
Set auditSec = CreateObject("DirectScript.ObjectSecurity")
'If D:\ is a NTFS volume
auditSec.AttachFile("d:\myfiles\foo.doc")
'Get/set audit properties of this file
'Attach another file. Connection to the earlier file is lost
auditSec.AttachFile("d:\myfiles\AnotherFoo.doc")
'Get/set audit properties of this file
'Attach Printer. Connection to the earlier file is lost
auditSec.AttachPrinter("\\lion\PrintFoo")
'Get/set audit properties of this printer
'Attach Registry key. Connection to printer lost
auditSec.AttachRegistryKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft")
'Get/set audit properties of this key