VBS example

' Script to add data to the audit log using WScript - the root
' object of the Windows Script Host object model hierarchy.
' The Admin Service must be started on the current computer.
'
' Run this script by typing the following :-
' WScript.exe Audit.vbs
' CScript.exe Audit.vbs
'

Dim AuditIt
' Echo a line to the console stating that we are about to add an
entry to the audit log.
WScript.Echo "About to add an entry to the audit log"
' Create an instance of the Audit COM object that is served by the
Admin Service.
' The id of the object is AdminService.EVAdminAudit
Set AuditIt = WScript.CreateObject("AdminService.EVAdminAudit")
' Audit the following values to the audit log.
' Parameter one is the category of the operation.
' Parameter two is the sub category
' Parameter three is the identifier of the object being audited.
' Parameter four is the status of the operation.
' Parameter five is the field to add any information required.
'

AuditIt.Audit "Test Category", "Test Sub Category", "ObjectId", "SUCCESS", "Info"
WScript.Echo "Finished the audit."