Windows Server logo

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

short PowerShell snippet for you to remove a computer object from Windows Server Update Services (WSUS)

Home » Windows Server » 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). 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("srv-01")
$client.delete()

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

Found this guide helpful? You can support my independent deep dives into Windows Server and DevOps by donating via PayPal. Every bit of support helps keep saotn.org fast and updated!

Jan Reilink
Jan Reilink

In my day to day work, I’m a systems administrator – DevOps / SRE and applications manager at Embrace – The Human Cloud. At Embrace we develop, maintain and host social intranets for our clients. Provide digital services and make working more efficient within various sectors.

Read why we can use your help and support ❤️

Articles: 173