Find Duplicate Records Name in CMDB Server List
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 03:37 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 04:17 AM
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);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 04:41 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 05:24 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2015 05:38 AM
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.