Microsoft Identity Integration Server 2003 Developer Reference

Example: Automatically Clearing the Operations Log

The following script can be run to delete information from the operation log up to the specified DeleteDate.

Option Explicit

On Error Resume Next

Dim Service
Dim Server
Dim DeleteDate
Dim When

Set Service = GetObject("winmgmts:\root\MicrosoftIdentityIntegrationServer")
Set Server = Service.Get("MIIS_Server.Name='TEST'")

When = DateAdd("m", -1, Now)

DeleteDate = DatePart ("yyyy", When) & "-" & DatePart("m", when) & "-" & DatePart("d", when)

WScript.Echo "Deleting Run Histories from " & DeleteDate

WScript.Echo "Result: " & Server.ClearRuns(DeleteDate)

Sub ErrorHandler (ErrorMessage)
  WScript.Echo ErrorMessage
  WScript.Quit(1)
End Sub