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.0
As a first step, we need to identify all problematic items by using following SQl query:
EXECUTE spGetItemGuidsByClass @classGuid='b2378265-2779-49e6-998d-8be620b3d9d9'
Results will be guids of all import rules.That guids them may be inserted into ItemToDelete table, so NS.Quarter hourly scheduled task may correctly clean them out from CMDB database. Simple query for inserting is following:
INSERT INTO ItemToDelete
SELECT Guid, GETDATE()
You can put guids of all rules one-by-one, or only those that you want to delete:
Insert into ItemToDelete
select Guid = 'put the guids from first query here', GETDATE()