Here is a little script I wrote for clearing the run history via script and using WMI.
Clear Run History Script
Dim Service
Dim ManagementAgent
Dim DeleteDate
Set Service = GetObject("winmgmts:\root\MicrosoftIdentityIntegrationServer")
Set Server = Service.Get("MIIS_Server.Name='MIIS_Server1'")
'// DeleteDate the date to use for the deletion of runs
DeleteDate = GETDELETEDATE( Date() - 1 )
WScript.Echo "Deleting Run Histories from " & DeleteDate
WScript.Echo "Result: " & Server.ClearRuns(DeleteDate)
'// ======================================================================
'// FUNCTION IIF
'// PURPOSE: To be able to execute an If...Then...Else statement on a single line
'// -- conditionalString: is the conditional statement to check via the IF
'// -- TrueString: if the condition is true, the statement to execute
'// -- FalseString: if the condition is false, the statement to execute
FUNCTION IIF(conditionalString, TrueString, FalseString)
IF conditionalString THEN
IIF = TrueString
ELSE
IIF = FalseString
END IF
END FUNCTION
'// ====================================================================
'// FUNCTION GETDELETEDATE
'// PURPOSE: The date has to be formatted in a special way to work with the sync engine.
'// using this function to help format the date.
FUNCTION GETDELETEDATE( TheDeleteDate )
GETDELETEDATE = YEAR(TheDeleteDate) & "-" & IIF(LEN(MONTH(TheDeleteDate))=1,"0" & MONTH(TheDeleteDate), MONTH(TheDeleteDate)) & "-" & IIF(LEN(DAY(TheDeleteDate))=1,"0" & DAY(TheDeleteDate), DAY(TheDeleteDate))
Richard Mueller edited Revision 15. Comment: Replace RGB values with color names in HTML to restore colors
Richard Mueller edited Revision 14. Comment: Added tags
Peter Geelen - MSFT edited Revision 11. Comment: layout scrambled
Peter Geelen - MSFT edited Revision 6. Comment: code not ok
Tim Macaulay edited Revision 3. Comment: added the see also section, and how to clear run history link to link back to the article that talks about clearing the run history