Due to various reasons, it may be required to delete obsolete AD import rules, that are not possible to delte from console itself.
Example: sometimes State of the import rule item may become corrupted and all attempts to delete it from AD import page, may fail and result to strange behavior of console, e.g. appearing of clones every X seconds, inability to edit any of these rules, missing items in CMDB, etc.
SMP 7.6, 8.x, 8.7.x
EXECUTE spGetItemGuidsByClass @classGuid='b2378265-2779-49e6-998d-8be620b3d9d9'
INSERT INTO ItemToDelete
SELECT Guid, GETDATE()
from vitem
where classGuid='b2378265-2779-49e6-998d-8be620b3d9d9'
Insert into ItemToDelete
select Guid = 'put the guids from first query here', GETDATE()