次の方法で共有


Clearing the Synchronization history in the WSUS console

You know how after you’ve been using WSUS for a while and you go into the admin console, then to the Synchronization node, you can end up waiting and waiting for the list to enumerate?  This is the list I’m talking about:

image

Have you ever wished you could just clear that list and start fresh?  Well with a simple SQL script now you can.  To do this, the first thing you’ll need to do is fire up the SQL Server Management Studio and connect to whatever server your WSUS server is using.  In my case I’m using SQL Server 2008 so mine looks like this:

image

Now if you’re using the Internal Database for WSUS then you’ll want to connect to \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query which is what I did below:

image

Next navigate to the SUSDB database:

image

Right-click on SUSDB and select New Query:

image

In the Query windows enter and execute the following query:

USE SUSDB
GO
DELETE FROM tbEventInstance WHERE EventNamespaceID = '2' AND EVENTID IN ('381', '382', '384', '386', '387', '389')

Just paste those three lines in the window and hit the Execute button:

image

On my system I get this.  Note the success at the bottom:

image

That’s about all there is to it so you can go ahead and close the SQL Management Studio.  Now when you go to the WSUS admin console it should look something like this:

image

Just like new.  Of course every time you make changes to any database you should make a backup first and this is no different.  Also a special thanks to Joe Tindale for the script above.  Thanks Joe!

J.C. Hornbeck | Manageability Knowledge Engineer

Comments

  • Anonymous
    January 01, 2003
    Thank you! I had 2165 records and it would hang the console for quite a while when loaded.
  • Anonymous
    January 01, 2003
    great post... thanks a million! what about a script that only deletes synchronizations where no changes occurred (no new, revised, or expired updates)?
  • Anonymous
    January 17, 2011
    Great post.. Thanks a lot. Really helpful
  • Anonymous
    November 15, 2011
    To leave the recent logs in the database, use:USE SUSDBGODELETE FROM tbEventInstance WHERE EventNamespaceID = '2' AND EVENTID IN ('381', '382', '384', '386', '387', '389') AND DATEDIFF(month, TimeAtServer, CURRENT_TIMESTAMP) >= 3;GOBest,Markus
  • Anonymous
    May 14, 2013
    Does anyone have a powershell script that I can use to do this?
  • Anonymous
    May 16, 2013
    Or delete from a spesific date and older:DELETE FROM tbEventInstance WHERE EventNamespaceID = '2' AND EVENTID IN ('381', '382', '384', '386', '387', '389') AND TimeAtServer < '2013-05-01'Very nice post!
  • Anonymous
    March 20, 2014
    Does anyone know what the different replication eventids represent? I can't seem to find the table that references them with names. I would like to only delete "cancelled" jobs. But a full listing would be cool.
  • Anonymous
    May 12, 2016
    I had 58 records and it would take almost 2 minutes for that tab to show results. What he heck?Thanks for this!
  • Anonymous
    December 19, 2016
    The original code gives me errors in SSMS 2016, and I had over 1800 syncs so needed this badly!... this doesn't:USE SUSDBGODELETE FROM tbEventInstance WHERE EventNamespaceID = '2' AND EVENTID IN ('381', '382', '384', '386', '387', '389')