Wsus freezes when you try to delete a computer group/target group from wsus console. Cannot delete a target group/computer group from wsus console.

Open SQL Management Studio and connect to SQL database or Microsoft inbuilt database \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query.

Right click the SUSDB database and select new query.

  1. Select * from dbo.targetgroup

This will list all the computer/target groups in the wsus console.

Find the target group id corresponding to the target/computer group which you want to delete.

  1. delete from dbo.tbTargetGroup where TargetGroupID = ‘****’

Execute the above query.

If the query gives you an error like “Msg 547, Level 16, State 0, Line 1

The DELETE statement conflicted with the REFERENCE constraint “FK__tbFlatten__Targe__1EF99443”. The conflict occurred in database “SUSDB”, table “dbo.tbFlattenedTargetGroup“, column ‘TargetGroupID’.

The statement has been terminated “ , follow the steps below

  1. select * from dbo.tbFlattenedTargetGroup where TargetGroupID = ‘****’

This query should get you a list with the target group id which you got from the statement 1 and the parent group id to which it is associated to.

  1. delete from dbo.tbFlattenedTargetGroup where TargetGroupID = ‘****’ AND ParentGroupID = ‘****’

You should see a message “ 1 row affected” .

Try to execute the statement

  1. delete from dbo.tbTargetGroup where TargetGroupID = ‘****’

This should give an error message “Msg 547, Level 16, State 0, Line 1

The DELETE statement conflicted with the REFERENCE constraint “FK__tbDeploym__Targe__442B18F2”. The conflict occurred in database “SUSDB”, table “dbo.tbDeployment“, column ‘TargetGroupID’.

The statement has been terminated. “

Now we should connect to the dbo.tbdeployment table.

The below query will list contents with target group id.

  1. select * from dbo.tbDeployment where TargetGroupID = ‘****’

The below query will delete the list from above query.

  1. delete from dbo.tbDeployment where TargetGroupID = ‘****’

Once the above query is completed successfully,

  1. delete from dbo.tbTargetGroup where TargetGroupID = ‘****’

And the computer/target group should be deleted successfully.

Execute the query “ Select * from dbo.targetgroup “ and you should not see the target group .

Open wsus console and confirm.

In Short, execute the commands in the order

  1. Select * fromtargetgroup
  2. delete from dbo.tbTargetGroup where TargetGroupID = ‘****’
  3. select * from dbo.tbFlattenedTargetGroup where TargetGroupID = ‘****’
  4. delete from dbo.tbFlattenedTargetGroup where TargetGroupID = ‘****’ AND ParentGroupID = ‘****’
  5. select * from dbo.tbDeployment where TargetGroupID = ‘****’
  6. delete from dbo.tbDeployment where TargetGroupID = ‘****’
  7. delete from dbo.tbTargetGroup where TargetGroupID = ‘****’
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s