Utility provided for deleting items based on GUID in the Altiris database
search cancel

Utility provided for deleting items based on GUID in the Altiris database

book

Article ID: 179249

calendar_today

Updated On:

Products

Client Management Suite IT Management Suite Server Management Suite

Issue/Introduction

Is there a utility that allows me to delete items based off of an item GUID?

Resolution

Caution: Remember to back up your database, or have a recent backup available, as a preventative measure.

We used to have an utility that could be used to delete a specific GUID from the database. We don't recommend doing that anymore. It is better to use the current delete framework process.

1. You could use the following query and feed the proper GUID values to it:

--Change the item attribute
update Item
set Attributes = 0
where Guid = 'Guid here'


--find dependencies
select i.Name, i2.Name, ir.Hint, ir.* from ItemReference ir 
left join Item i on i.Guid = ir.ParentItemGuid
left join Item i2 on i2.Guid = ir.ChildItemGuid
where ParentItemGuid = 'Guid here'
OR ChildItemGuid = 'Guid here'


--Delete references from ItemReference table
delete from ItemReference
where ParentItemGuid = 'Guid here'
or ChildItemGuid = 'Guid here'


--Insert item into ItemToDelete table and let the delete framework to remove any other reference
insert into 
ItemToDelete (Guid, DeleteDate)
values ('Guid here', GETDATE ())

2. After the GUID(s) have been added to the ItemToDelete table, run the "NS.Quarter-Hour.{5834ae07-1160-4037-8a25-67aebf6a254e}" Scheduled Task under Task Scheduler.