다음을 통해 공유


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 we are talking about:

https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/sus/WindowsLiveWriter/ClearingtheSynchronizationhistoryintheWS_8CB0/image_thumb_1.png

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 this case, we are using SQL Server 2008 so it looks like this:

https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/sus/WindowsLiveWriter/ClearingtheSynchronizationhistoryintheWS_8CB0/image_thumb_2.png

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 we did below:

https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/sus/WindowsLiveWriter/ClearingtheSynchronizationhistoryintheWS_8CB0/image_thumb_3.png

Next, navigate to the SUSDB database:

https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/sus/WindowsLiveWriter/ClearingtheSynchronizationhistoryintheWS_8CB0/image_thumb_5.png

Right-click on SUSDB and select New Query:

https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/sus/WindowsLiveWriter/ClearingtheSynchronizationhistoryintheWS_8CB0/image_thumb_6.png

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:

https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/sus/WindowsLiveWriter/ClearingtheSynchronizationhistoryintheWS_8CB0/image_thumb_7.png

On this system, we get this.  Note the success at the bottom:

https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/sus/WindowsLiveWriter/ClearingtheSynchronizationhistoryintheWS_8CB0/image_thumb_8.png

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:

https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_technet/sus/WindowsLiveWriter/ClearingtheSynchronizationhistoryintheWS_8CB0/image_thumb_9.png

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 special thanks to Joe Tindale for the script above.  Thanks, Joe!

ref: http://blogs.technet.com/sus/archive/2009/03/04/clearing-the-synchronization-history-in-the-wsus-console.aspx

Other Language:
Borrar la historia de sincronización en la consola de WSUS (es-ES)