Find Duplicate Records Name in CMDB Server List

Mohamed Faizel
Giga Expert

Hi,

I would like to get the duplicate records in "cmdb_ci_win_server" table by name, Is there any way to get it, Please help on on this. I tried some background scripts but those are not working.

Thanks,

Mohamed Faizeal.

9 REPLIES 9

Harish Murikina
Tera Guru

Try this



var count = new GlideAggregate('cmdb_ci_win_server');


count.addAggregate('COUNT', 'name'); // here


count.query();    


while (count.next()) {


    var name= count.name;


    var categoryCount = count.getAggregate('COUNT', 'name');


  gs.log("The are currently " + categoryCount + " CIS with a name of " + name);


}






Deepak Ingale1
Mega Sage

Along with the code provided by Harish, in excel 2013, there is an option to highlight duplicate values in column selected.


You can even make use of that by exporting your server data to excel sheet where you don't need a script to write in background.


Mike Allen
Mega Sage

You can go to cmdb_ci.list and right-click on the Name column and group by name.   That is a quick and easy way to see your duplicates.


Thanks for the replies, i will try the haish code now.



Actually i want to schedule report for the duplicate records, thats what i am looking for a scripts.



Thanks.