Deleting clients from WSUS using powershell

Welcome Forums General PowerShell Q&A Deleting clients from WSUS using powershell

Viewing 0 reply threads
  • Author
    Posts
    • #221988
      Participant
      Topics: 3
      Replies: 6
      Points: 38
      Rank: Member

      Hello,

      Am list of servers that have been deleted in AD and am planning to delete them as well in our WSUS server. I am using below code to delete the devices but it is not working. Hoping that someone could help me check what is wrong with the code. Thanks in Advance guys.

      $Computername = ‘WSUSServer’
      $UseSSL = $False
      $Port = 8530

      [reflection.assembly]::LoadWithPartialName(“Microsoft.UpdateServices.Administration”) | Out-Null
      $Wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::GetUpdateServer($Computername,$UseSSL,$Port)
      $Group = $wsus.GetComputerTargetGroup(‘a0a08746-4dbe-4a37-9adf-9e7652c0b421’)
      $Clients = Get-Content C:\BackUp\PScripts\SDO\serverlist.txt
      $Device = $Wsus.SearchComputerTargets($Clients)
      $client[0].Delete()

Viewing 0 reply threads
  • You must be logged in to reply to this topic.