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.
Failed to run WSUS Server Cleanup. Error: The DELETE statement conflicted with the REFERENCE constraint "FK__tbExpande__Targe__1881A0DE". The conflict occurred in database "SUSDB", table "dbo.tbExpandedTargetInTargetGroup", column 'TargetID'.
The statement has been terminated.
The ‘CleanupObsoleteComputers’ switch invokes a Stored Procedure in the
Continue reading WSUS: Failed to run WSUS Server Cleanup. Error: The DELETE statement conflicted with the REFERENCE constraint