Remove computer object from Windows Server Update Services (WSUS) in PowerShell

Here is a short PowerShell snippet for you to remove a computer object from Windows Server Update Services (WSUS).
Published on Monday, 4 October 2021

In an elevated PowerShell session, adjust the following to your environment and execute:


$WSUS_server = 'wsus-srv-01'
$UseSSL = $True
$Port = 8531

[reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration") | Out-Null
$Wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer($WSUS_server,$UseSSL,$Port)
$client = $wsus.SearchComputerTargets("host-01")
$client.delete()

This removes the server named "host-01" computer object from WSUS on host wsus-srv-01.