Unable to delete an item after adding it directly to the ItemToDelete table. Using a similar query:
insert into ItemToDelete
select guid, GETDATE()
from item where guid = '777f5c01-add9-467e-91c4-b8ba0c671f94' --<Item Guid To Delete>
The following error occurred:
Item attributes (NoDelete) do not include deletion for: 'DESK03_TEST' (777f5c01-add9-467e-91c4-b8ba0c671f94)
Error in the application.
[Altiris.NS.Exceptions.ItemSecurityException @ ]
Exception logged from:
at Altiris.NS.ItemManagement.Item.Delete()
at Altiris.NS.ItemManagement.Item+<>c__DisplayClass395_0.<DeleteItem>b__0(Altiris.Database.IDatabaseContext)
at Altiris.NS.ContextManagement.<>c__DisplayClass31_0<T>.<PerformWithDeadlockRetry>b__0(Altiris.Database.IDatabaseContext)
....
-----------------------------------------------------------------------------------------------------
Date: 6/23/2020 3:38:37 PM, Tick Count: 1857999468 (21.12:06:39.4680000), Size: 6.63 KB
Process: AeXSvc (33944), Thread ID: 87, Module: Altiris.NS.dll
Priority: 1, Source: Item.Delete
ITMS 8.0 and later
The actual attribute for this item was set to "16", which means "NoDelete".
select Guid, Name, Attributes from Item
where GUID = '<Item Guid To Delete>'
Update Item
set Attributes = 0
where Guid = '<Item Guid To Delete>'
select * ItemToDelete
where guid = '<Item Guid To Delete>'
insert into ItemToDelete
select guid, GETDATE()
from item where guid = '<Item Guid To Delete>'