Patrick DeCarl1
ServiceNow Employee
ServiceNow Employee

What needs to be updated to allow more than 1 SCCM database to be active

  1. Update Or copy OOTB script include "SCCMHelper"
    1. Update function findComputer
      1. Include new pram source
      2. For the first query(cmdb_ci_computer) include "grc.addQuery("discovery_source", source);
      3. For the second query (sys_object_source) update grs.addQuery("name", "SCCM"); --> grs.addQuery("name", source);

find_real_file.png

 

Update the OOTB Transform Maps:

  1. SCCM 2016(or whatever year) Computer Identity:
    1. New Field Map to set discovery_source to SCCMfind_real_file.png
      1. Check the onAfter Script to make sure "var sourceObj = new ObjectSource("SCCM", target.sys_class_name, target.sys_id, source.u_resourceid + '');" is in place.
      2. ** For new datasource make sure to update sys_id mapping script o update lines:
        1. "var IMPORT_NAME = "SCCM";" (Change SCCM value to your new one)
        2. " gr.addQuery("name", "SCCM");" (Change SCCM value to your new one)
        3. "var sourceObj = new ObjectSource("SCCM", target.sys_class_name, target.sys_id, source.u_resourceid + '');" (Change SCCM value to your new one)
  2. SCCM 2016 Disk:
    1. In the script box update the following to include SCCM as source:
      1. SCCMHelper.findComputer(source.u_resourceid, "SCCM"))find_real_file.png
    2. Update field map computer script to be answer = SCCMHelper.findComputer(source.u_resourceid, "SCCM");find_real_file.png
    3. Create new Field map to set discovery_source to SCCM
  3. SCCM 2016 Network:
    1. In the script box update the following to include SCCM as source:
      1. var computer_sysid = SCCMHelper.findComputer(source.u_resourceid, "SCCM");find_real_file.png
    2. Update field map cmdb_id script to be: answer = SCCMHelper.findComputer(source.u_resourceid, "SCCM");find_real_file.png
    3. Create new Field map to set discovery_source to SCCM
  4. SCCM 2016 Operating System:
    1. Create new Field map to set discovery_source to SCCM
    2. Update field map sys_id script to be: answer = SCCMHelper.findComputer(source.u_resourceid, "SCCM"); see above screenshots for examples. 
  5. SCCM 2016 Processor:
    1. Create new Field map to set discovery_source to SCCM
    2. Update field map sys_id script to be: answer = SCCMHelper.findComputer(source.u_resourceid, "SCCM");
  6. SCCM 2016 Incremental Import under data source SCCM 2016 Removed Software:
    1. Update the onStart script:
      1. Update line 39 "var cid = SCCMHelper.findComputer(id);" to "var cid = SCCMHelper.findComputer(id, "SCCM");"
  7. SCCM 2016 Incremental Import under SCCM 2016 Removed Software (AI) data source:
    1. Update the onStart script:
      1. Update line ~39 "var cid = SCCMHelper.findComputer(id);" to "var cid = SCCMHelper.findComputer(id, "SCCM");"find_real_file.png
  8. Incremental Import (SAM enabled) 2016 under data source SCCM 2016 Software:
    1. In the script box update the following to include SCCM as source:
      1. if (JSUtil.nil(SCCMHelper.findComputer(source.u_resourceid, "SCCM")))
    2. Create new Field map to set discovery_source to SCCM
    3. Update field map installed_on script to be: answer = SCCMHelper.findComputer(source.u_resourceid, "SCCM");
  9. If active Incremental Import 2016 under data source SCCM 2016 Software:
    1. Update the onAfter script:
      1. var sys_id = SCCMHelper.findComputer(source.u_resourceid); to var sys_id = SCCMHelper.findComputer(source.u_resourceid, "SCCM");
  10. Incremental Import (SAM enabled) 2016 under data source SCCM 2016 Software (AI):
    1. In the script box update the following to include SCCM as source:
      1. if (JSUtil.nil(SCCMHelper.findComputer(source.u_resourceid, "SCCM")))
    2. Create new Field map to set discovery_source to SCCM
  11. Create All new Data sources for other SCCM DBs:
    1. Create all new data sources based on OOTB ones for other SCCM instances, but make sure you create new source tables, also run through the same steps above but instead of SCCM put your new discovery source for second SCCM. Make sure this value is saved on the choice list table for discovery source.

If other screenshots are needed to help understand the steps let me know. 

 

If you found this helpful, please click helpful button below. 

Version history
Last update:
‎04-17-2020 10:13 AM
Updated by: