IAuditSecurity Method: AttachFile

AttachFile
(
FileorDirectoryPath As String,
[LookupComputer] As String,
[DontSaveChanges] As Boolean
);

Parameters

[in] String FileorDirectoryPath
Path of the file or directory whose audit is to be read. This parameter can be a local path (C:\WINNT) or a UNC path (\\COMPUTERNAME\SHARENAME\FILENAME).

[in] String LookupComputer
This is an optional parameter. The computer to be used to look for user and group accounts. If the parameter is not specified, the local computer is assumed by default. This parameter is useful when the accounts do not belong to the current domain or its trusted domains or current computer, but are local to a computer or another domain.

[in] Boolean DontSaveChanges
This is an optional parameter. This flag indicates whether the operations done on an object should be saved to the disk. This parameter is ignored in the current implementation.

Description
Initializes the audit security for the specified file.

Example

Dim AuditSec  As IAuditSecurity
Dim strFilePath  As String
strFilePath = "d:\test.txt"
Set AuditSec = CreateObject("DirectScript.ObjectSecurity")
'Attach to the File d:\test.txt on the local machine
AuditSec.AttachFile strFilePath

 

See Also