ClearRuns Method of the MIIS_Server Class

The ClearRuns method removes run histories from the server with a run end date that is earlier than or equal to the specified date. To use this method, you must be logged on as a member of the MIISOperators or the MIISAdmins security group.
Caution  This method permanently removes the stored run histories from the server. If you need to preserve the run history, use the MIIS_RunHistory object to retrieve the run histories prior to deleting them from the server.

Syntax

    string ClearRuns(
      [in]  string EndingBefore
    );

Parameters

  • EndingBefore [in]
    Contains the date and time string, in Coordinated Universal Time (UTC), of the latest run that will be deleted from the server. Runs after this specified date and time will be preserved.

    Note  If you want to delete the run histories based on a local date and time, convert the local time to UTC.

    The format of this parameter is yyyy-MM-dd HH:mm:ss.fff.

    Format specifier Description
    yyyy Specifies the four-digit year
    MM Specifies the two-digit month in the range of 1 to 12
    dd Specifies the two-digit day of the month in the range of 1 to 31
    HH Specifies the two-digit hour of the day in 24-hour format in the range of 0 to 23
    mm Specifies the two-digit minute of the day in the range of 0 to 59
    ss Specifies the two-digit second of the day in the range of 0 to 59
    fff Specifies the three-digit fractions of a second in the range of 0 to 999

    Note  To delete run histories by date only, omit the time units in the parameter.

Return Value

Returns a string that contains the final status of the method. The return value can be one of the values listed in the Return Strings topic or one of the following values.

Return code Description

success

The run histories with end times earlier than the specified time were successfully deleted from the server.

access-denied

The user running this method is not a member of the Microsoft Identity Integration Server 2003 security groups. Verify that the user is a member of one of these groups.

invalid-date-parameter

The specified date is in the wrong format or run histories do not exist for this date. Verify that the specified date is in the correct format.

Remarks

We recommended that you remove run histories regularly from the server, since a large number of run histories can detract from the performance of Identity Manager.

Examples

The following example shows you how to use Visual Basic Scripting Edition (VBScript) to delete run histories from the server with a run end date that is earlier than or equal to March 31, 2003 (UTC).

Dim Service
Dim ManagementAgent
Dim DeleteDate

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

DeleteDate = "2003-03-31"

WScript.Echo "Deleting Run Histories from " & DeleteDate

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

The following example shows you how to delete the run histories with a run end date that is earlier than or equal to the time 13:25:00.000 on March 31, 2003 (UTC).

Dim Service
Dim ManagementAgent
Dim DeleteDate

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

DeleteDate = "2003-03-31 13:25:00.000"

WScript.Echo "Deleting Run Histories from " & DeleteDate

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

Requirements

Product ILM 2007 FP1
MOF Mmswmi.mof

See Also

MIIS_Server
Return Strings

Send comments about this topic to Microsoft

Build date: 2/16/2009