Client Management Suite

 View Only
  • 1.  Query to Delete Computer Objects from Database (Altiris 7.5)

    Posted Jan 23, 2014 12:10 AM

    Hi all,

    I'm not sure if this has changed much or not, but I am wondering how to delete a number of computer resources from the Atliris 7.5 database.  I know that in the past, spResourceDelete has been used, but i want to make sure I keep the DB clean while removing large batches of computers at a time.

    Does anyone know a good query to do this?

     

    I ran a SQL Trace while deleting an ojbect using the console and saw the following statements.  I am wondering if there is one sp that does it all for 7.5.

     

    exec spResourceDelete @Guid='4160FB7D-5F26-4FCA-A0B3-923EB20A7B53',@IsPartitioned=1
     
    insert [ItemDeleted] ([ItemGuid], [ItemClassGuid], [ItemName], [DeletedDate])
    values (@ItemGuid, @ItemClassGuid, @ItemName, getdate())
     
    exec spItemDeletedInsUpd3 @ItemGuid='4160FB7D-5F26-4FCA-A0B3-923EB20A7B53',@ItemClassGuid='539626D8-A35A-47EB-8B4A-64D3DA110D01',@ItemName=N'RTEM00504PC003'
     
    exec spDeleteItemFolderCacheEntries @Guid='4160FB7D-5F26-4FCA-A0B3-923EB20A7B53',@IsFolder=0,@IsResource=1
     
    exec spDeleteAllItemReferences @ParentItemGuid='4160FB7D-5F26-4FCA-A0B3-923EB20A7B53'


  • 2.  RE: Query to Delete Computer Objects from Database (Altiris 7.5)

    Posted Jan 23, 2014 12:34 AM
    The easiest way would be to insert their guids into the ItemsToDelete table and then wait for the background process to run during the early hours. The ASDK also has a method you can use.


  • 3.  RE: Query to Delete Computer Objects from Database (Altiris 7.5)

    Posted Jan 23, 2014 03:25 PM

    ItemManagementLib..::.DeleteItem Method

     

    C#
    // See ItemManagementLib Overview for an example of setting up m_proxy.
    m_proxy.DeleteItem(clonedObject.Guid);

    VBScript
    call itemManagement.DeleteItem(clonedObject.Guid)

    CLI
    AltirisASDKNS.exe cmd:DeleteItem "itemGuid:%itemGuid%"
     

    The COM and CLI layers take and return guids represented as strings.