Symantec Management Platform (Notification Server)

 View Only
  • 1.  Programmatically delete computer

    Posted Jan 07, 2022 11:40 AM
    We would like to daily delete computer who are being mark as retired.  We don't want to wait XX months and use the purging maintenance.

    Is it ok to delete a computer by using the stored procedure spResourceDelete (spResourceDeleteBulk)?

    this way, I'll write and SQL query to delete computers who are being marked as retired by technician.

    Thanks!!


  • 2.  RE: Programmatically delete computer

    Posted Jan 14, 2022 06:11 AM
    Edited by Hannah Massie Jan 14, 2022 06:13 AM

    I did something similar for a customer a couple of years ago. In this case we created a custom table to record the systems we'd deleted and then did the delete. We used the ItemtoDelete table for the deletion rather than trying to run the delete stored procedure as if my memory serves me right this takes care of all the clean up

    There was a query which ran as an automation policy to select the computers and the results of this were then put into a task which did the 'delete'. Query in task was as below

    -- This put the details we wanted to record for deleted computers in the custom table

    Insert into Custom_Computers_Auto_Deleted Values ('%!Guid!%','%!Name!%','%!Domain!%','%!IP Address!%', '%!Asset Tag!%', '%!Model!%', '%!Last Logon User!%','%!Last Inventory Received!%','%!Ad Last Logon!%','%!Date Deleted!%')

    -- This then added the systems to the OOB ItemToDelete table which would then delete them

    Insert into ItemToDelete Values ('%!Guid!%', Dateadd(dd,-1,Getdate()))


    Hope this helps