Removing Duplicate Records from sys_object_source (Source) from SCCM/KeyServer imports
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2020 08:06 AM
Hey all!
Last year I developed an equipment loan process for our Labs Desk Laptop Sign Out Program. We use KeyServer and SCCM to populate our Configuration Items so I decided to utilize the wealth of information in the Configuration table so that we could better track the Laptops. It's been working well for the past year, but last month we discovered that 11 out of the 16 devices disappeared from the Configuration Items in ServiceNow, but I can find them in the tables that populate the SCCM and KeyServer data to our ServiceNow instance.
Long story short, we've narrowed the issue down to duplicate records that are in the sys_object_source (Source) table. Our systems team just want to delete the data, but ServiceNow does not allow us to delete data from that table. Our system's guy is referencing posts and documentation from Jakarta thru London:
https://community.servicenow.com/community?id=community_question&sys_id=4a734f25dbd8dbc01dcaf3231f96...
From what I can see is that it looks like you use to be able to delete directly from this table, but it looks like ServiceNow developed a wizard/process for remediating duplicate records (Duplicate CI Remediator wizard, looks like this started in Kingston): https://docs.servicenow.com/bundle/newyork-servicenow-platform/page/product/configuration-management...
So the big question is what is the proper way for removing these duplicates?
1. Our systems team just wants to delete the record from the sys_object_source (Source) table but the system does not allow that, so how would they delete the record.
2. We use the Duplicate CI Remediator wizard to remediate the Configuration Items.
From what I can see, I think the proper way to proceed is to use the wizard, but our systems team wants to check to see if we can just delete the records. Any advice would be appreciated.
Emmon Johnson
ITS Customer Support Solutions Specialist
SUNY Oneonta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2020 12:39 AM
If you look into ACLs of this table, you can see write and delete actions are only allowed for "maint" role. It is possible to create new ACLs for the table to allow them for "admin" role as well.
I added the ACLs and wrote the below script to delete 10 records, but interestingly it dropped all records instantly after running the script. Not an issue for me as that was my intention eeventually, but if you just want to delete some records only then I suggest to be careful.
var gr = new GlideRecord('sys_object_source');
gr.addQuery('name','!=', '');
gr.setLimit(10); //Set limit how many to delete
gr.query();
gs.log('Amount of sys_object_source records to be deleted: ' + gr.getRowCount());
while (gr.next()) {
gr.deleteMultiple();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2022 10:47 AM
While this thread is old... KB article KB0746309 reveals that Admin role can be added to the delete ACL to allow admin's ability to delete records in sys_object_source table