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

book

Article ID: 179249

calendar_today

Updated On:

Products

Management Platform (Formerly known as Notification Server) Client Management Suite IT Management Suite Server Management Suite

Issue/Introduction

Question

Is there a utility that allows me to delete items based off of an item GUID?
This can be used for deleting many objects in the Notification Server Altiris database.

Resolution

Answer
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.

Attachments

DeleteItem.zip get_app
DeleteItem.zip get_app