I have another article about duplicate record scripts. That post covers how to find a duplicate in one column of table in ServiceNow.
However for the CI Relationship table, there are two columns (Parent and Child) that determine unique. Here is a trick using excel to find duplicates in the CI Relationship table.
Step 1: ServiceNow Data Export
- In the left navigator, type cmdb_rel_ci.list
- Build your filter that you want to check for duplicates.
- Right click header bar Export > Excel
Step 2: Excel Find Uniques
- Open exported file in Excel
- Ribbon > Data > Sort
- Sort by Parent and then by Child
- Click Ok
- Add Column, Label: Unique
- Select Parent and Child Columns
- Ribbon > Data > Advanced
- Click "Unique" Checkbox
- Click Ok
- Add an "X" to all the unique rows
- Ribbon > Data > Clear
Step 2: Excel Find Duplicates
- In Excel, Ribbon > Filter
- On the Unique column you created, use the filter to find the blanks
Now you have a list of duplicates. You can now manually deactivate or remove these duplicates. For a large list, you can build a OR gliderecord query to remove them..
Hope that helps,