WSUS: Failed to run WSUS Server Cleanup. Error: The DELETE statement conflicted with the REFERENCE constraint

I received the following error when running the ‘Invoke-WsusServerCleanup -CleanupObsoleteComputers’ command on a WSUS instance. From searching through the database the problem appears to have been caused by a computer changing its Target Computer Group, but not being completely unassigned from the old computer group.

The ‘CleanupObsoleteComputers’ switch invokes a Stored Procedure in the database. This Stored Procedure has been used and modified to clean up the incorrect records, and remove the computers.

1. Connect to the SUSDB instance. For the local Windows Internal Database this is at: \\.\pipe\MICROSOFT##WID\tsql\query
2. Run the following script:

Be the first to like.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.