Does anyone have an asset report to show duplicate CI's?

ladrake
Mega Expert

We have duplicate CI records that we need to purge from the system, but I'm not sure of how to build a report or script to identify these duplicates.   It seemed that there was a previous method in place for versions older than Fuji.

11 REPLIES 11

Agree with Matthew and here is additional information on how you can leverage a function like this in a list query:



Find duplicate user email (or anything else)



Very old post, but it will still work.


I have to disagree here. The ideas sound correct, but the script and logic do not work for a complex scenario such as finding duplicate CIs.



Matthew's script produces a list of values that are duplicates in any of the records, but not a list of records that are duplicates. In fact, by trying a list of "name" and "serial_number", I get a list of names where more than one item has that name and a list of serial_numbers where more than one item has that serial_number, but neither is particularly valuable, because neither alone is enough to identify a duplicate.



To find a single duplicate value in a table and produce a list of it... sure, that works, but to produce a list of CIs where "Class is the same, and at least on of serial_number, asset_id, or IP address" are the same is not possible with the above structure.



-Ken


Hi Jeff, thanks for providing this information. I think it will be helpful


for expanding the information that we are currently tracking.



Kind Regards,




Larry Drake


I.T. Services Manager



Brady Corporation414 228-3252 (o)


414 807-2945 (m)





This e-mail and any attachments contain confidential information. This


e-mail is intended solely for the use of the individual or entity to which


it is addressed. If you are not the intended recipient of this e-mail, you


are hereby notified that any copying, distribution, dissemination or action


taken in relation to the contents of this e-mail and any of its attachments


is strictly prohibited and may be unlawful. If you have received this


e-mail in error, please notify the sender immediately and permanently


delete the original e-mail and destroy any copies or printouts of this


e-mail as well as any attachments.



On Tue, Aug 1, 2017 at 3:28 PM, jaboltz <community-no-reply@servicenow.com>


Community Alums
Not applicable

Keep an eye out for the upcoming Helsinki release. You can check it out at Knowledge 16 if you will be there. It includes a CMDB Health Dashboard that lets you report on "the three Cs": Completeness, Compliance, and Correctness. The Correctness includes details on Duplicate CIs and creates tasks for you to address the duplicates found. At this point I am unfamiliar with the criteria it uses to determine the duplicates, but you can create remediation workflows to address the duplicates found.


Syaharruddin
Mega Guru

I use background script to find duplicates. You can also create a scheduled job to run the script and generate incidents for remediation.



We've done it in our sub-production instance but not in Prod yet.



var cItem = new GlideAggregate('cmdb_ci_computer');


cItem.addEncodedQuery('serial_numberISNOTEMPTY');


cItem.addAggregate('COUNT', 'serial_number');


cItem.groupBy('serial_number');


cItem.addHaving('COUNT', '>', 1);


cItem.query();


while (cItem.next()) {


    gs.log(cItem.serial_number.toString());


}



Side notes ...


We use Microsoft SCCM for discovery. From the incidents, we realized that some of the issues are from fulfillment center / agents replacing hard drives and / or motherboard without updating the asset info which caused the duplicates.