
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2018 10:06 AM
Hello ITAM/CMDB colleagues,
I wanted to share a success I had with a support ticket and the MakeandModelJS script include, and pose a question. There is a community post here
that talks about MakeandModelJS. My support ticket gave a guidance on the usage, and I have found two things.
1) the code given contains an if statement with triple equal signs, which works when you test in background scripts, but does not work in the SCCM integration in the instance. Remove one equal sign making it two equal signs, and it works. It does test out either way in Background Scripts, so you cannot rely on Background Scripts in some cases, always be skeptical of this.
2) Matching on manufacturer and model name alone is not enough. Many model names have multiple model numbers, so when I used the code in the SCCM integration, i need to match on manufacturer, model name, and model number. Since this is an OOB feature I will need to go back to Support for this. Has anybody else used MakeandModelJS in the SCCM integration to match models? SCCM is providing only a model number in u_model in the SCCM source data, so I am implementing a lookup table using these if statement matches on the value of u_model.
In the attachment you see I have to use "ThinkCentre M93P 01" to make the model name lookup unique for this particular model number. Doing it this way works, but I don't want to have to modify my model names like this. I should be matching on Model name and Model Number in the hardware model table.
Thanks
Solved! Go to Solution.
- 4,574 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2022 02:26 PM
Closing this in lieu of upgrading to San Diego and upgrading our SCCM integration from "SCCM 2012 v2" to "Service Graph connector for Microsoft SCCM (3.0.6)". The enhancement appears to not have moved forward, but may have had some impact on ITAM development...
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 07:12 PM
Hi @Houston Vargas,
Sorry for the delayed response.
I updated the "CmdbIntegrationHardwareModelUtil" Script Include to add the following new function:
// Customisation for model number
cleanseModelNumberAndCompany: function(companyName, modelName, modelNumber) {
var result = {};
if (!modelName && !companyName)
return result;
if (!modelName && companyName)
return this.cleanseCompany(companyName);
if (companyName)
companyName = new CmdbIntegrationCompanyModelUtil().cleanseCompany(companyName);
var mmn = new sn_cmdb_int_util.MakeAndModelAndNumberJs().fromNames(companyName, modelName, modelNumber, "hardware");
result.modelSysId = gs.nil(mmn.model_id_sys_id) ? '' : mmn.model_id_sys_id;
result.modelName = gs.nil(mmn.model_id_name) ? '' : mmn.model_id_name;
result.companySysId = gs.nil(mmn.manufacturer_sys_id) ? '' : mmn.manufacturer_sys_id;
result.companyName = gs.nil(mmn.manufacturer_name) ? '' : mmn.manufacturer_name;
return result;
},
The "Cleanse Hardware Model" RTE Operation Type I updated as follows to include the lines commented with Customisation for model number:
(function(batch, output) {
for (var i = 0; i < batch.length; i++) {
// input is manufacturer name then model name in order
var manufacturer_in = batch[i].input_0;
var model_in = batch[i].input_1;
// Customisation for model number
var model_num_in = batch[i].input_2;
if (!manufacturer_in && !model_in) {
output[i] = '';
continue;
}
// Customisation for model number
var result;
if ((manufacturer_in == 'LENOVO' || manufacturer_in == 'Lenovo') && model_num_in) {
result = new sn_cmdb_int_util.CmdbIntegrationHardwareModelUtil().cleanseModelNumberAndCompany(manufacturer_in, model_in, model_num_in);
} else {
result = new sn_cmdb_int_util.CmdbIntegrationHardwareModelUtil().cleanseModelAndCompany(manufacturer_in, model_in);
}
if (!result) {
output[i] = '';
continue;
}
var companyName = result.companyName ? result.companyName : '';
var companySysId = result.companySysId ? result.companySysId : '';
var modelName = result.modelName ? result.modelName : '';
var modelSysId = result.modelSysId ? result.modelSysId : '';
// output is <core_company.sys_id>|||<core_company.name>|||<cmdb_model.sys_id>|||<cmdb_model.name>
output[i] = companySysId + "|||" + companyName + "|||" + modelSysId + "|||" + modelName;
}
})(batch, output);
The "Cleanse manufacturer" Robust Transform Engine Entity Cleanse Hardware Model Operation was modified to add "u_productversion" to the list of Source Fields:
I hope this helps.
Dean.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2023 04:02 PM
Hi Treidfb. Did you have any luck utilizing the makeandmodel api to incorporate model number?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2023 08:47 PM
Hi Ryan,
I'm currently implementing Service Graph Connector for SCCM for my company and ran into a similar issue with needing model numbers to match existing hardware models. I have discovered an undocumented API "MakeAndModelAndNumberJs" (sn_cmdb_int_util.MakeAndModelAndNumberJs) in the Integration Commons for CMDB plugin, which so far seems to perform exactly what is needed to match on manufacturer, model name, and model number.
I've customised the CmdbIntegrationHardwareModelUtil API to be able to use the MakeAndModelAndNumberJs API, as well as modifying the "Cleanse Hardware Model" RTE Entity Operation Type and the "Cleanse manufacturer" Robust Transform Engine Entity Cleanse Hardware Model Operation to pass in the model number from the SG-SCCM RTE.
Be aware that MakeAndModelAndNumberJs is undocumented, so use with caution. Feel free to contact me if you have any questions around what I've done so far.
Regards,
Dean.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2023 03:06 AM
Hi Dean,
Is it possible to provide more info on this please? I seem to be running into the same issue. Looks like we have a lot of oddities with SCCM and I believe this API might work for our situation. What did you customize exactly for the "Cleanse Hardware Model", "Cleanse Manufacturer" RTE, and "Cleanse Hardware Model"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 07:12 PM
Hi @Houston Vargas,
Sorry for the delayed response.
I updated the "CmdbIntegrationHardwareModelUtil" Script Include to add the following new function:
// Customisation for model number
cleanseModelNumberAndCompany: function(companyName, modelName, modelNumber) {
var result = {};
if (!modelName && !companyName)
return result;
if (!modelName && companyName)
return this.cleanseCompany(companyName);
if (companyName)
companyName = new CmdbIntegrationCompanyModelUtil().cleanseCompany(companyName);
var mmn = new sn_cmdb_int_util.MakeAndModelAndNumberJs().fromNames(companyName, modelName, modelNumber, "hardware");
result.modelSysId = gs.nil(mmn.model_id_sys_id) ? '' : mmn.model_id_sys_id;
result.modelName = gs.nil(mmn.model_id_name) ? '' : mmn.model_id_name;
result.companySysId = gs.nil(mmn.manufacturer_sys_id) ? '' : mmn.manufacturer_sys_id;
result.companyName = gs.nil(mmn.manufacturer_name) ? '' : mmn.manufacturer_name;
return result;
},
The "Cleanse Hardware Model" RTE Operation Type I updated as follows to include the lines commented with Customisation for model number:
(function(batch, output) {
for (var i = 0; i < batch.length; i++) {
// input is manufacturer name then model name in order
var manufacturer_in = batch[i].input_0;
var model_in = batch[i].input_1;
// Customisation for model number
var model_num_in = batch[i].input_2;
if (!manufacturer_in && !model_in) {
output[i] = '';
continue;
}
// Customisation for model number
var result;
if ((manufacturer_in == 'LENOVO' || manufacturer_in == 'Lenovo') && model_num_in) {
result = new sn_cmdb_int_util.CmdbIntegrationHardwareModelUtil().cleanseModelNumberAndCompany(manufacturer_in, model_in, model_num_in);
} else {
result = new sn_cmdb_int_util.CmdbIntegrationHardwareModelUtil().cleanseModelAndCompany(manufacturer_in, model_in);
}
if (!result) {
output[i] = '';
continue;
}
var companyName = result.companyName ? result.companyName : '';
var companySysId = result.companySysId ? result.companySysId : '';
var modelName = result.modelName ? result.modelName : '';
var modelSysId = result.modelSysId ? result.modelSysId : '';
// output is <core_company.sys_id>|||<core_company.name>|||<cmdb_model.sys_id>|||<cmdb_model.name>
output[i] = companySysId + "|||" + companyName + "|||" + modelSysId + "|||" + modelName;
}
})(batch, output);
The "Cleanse manufacturer" Robust Transform Engine Entity Cleanse Hardware Model Operation was modified to add "u_productversion" to the list of Source Fields:
I hope this helps.
Dean.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2023 02:13 PM
Thanks a lot deanmpage for adding to this community post. I have not been working in this area lately but I am super happy to see the progress that has been made. Cheers, Tim