Partager via


ClearRuns Method

Removes run histories from the server that have 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 security group or the MIISAdmins security group.

Note

This method permanently removes the stored run histories from the server. If you want to preserve the run history, use the MIIS_RunHistory object to retrieve the run histories before you delete them from the server.

mof
string ClearRuns( [in] string EndingBefore
);

Parameters

In Language Name Data Type Description

1

mof

EndingBefore

string

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 are 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.

Name : ClearRuns

Return Value

string

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

Name Description

success

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

access-denied

The user who is running this method is not a member of the Forefront Identity Manager Synchronization Service (FIM Synchronization Service) 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, because a large number of run histories can detract from the performance of Synchronization Service Manager.

Example

The following example shows how to use Microsoft 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 how to delete the run histories that have 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

Forefront Identity Manager Synchronization Service 2010

MOF

Mmswmi.mof

See Also

Reference

MIIS_Server Class
WMI Provider Return Strings

Concepts

Methods
WMI Provider Reference