Removing Software Installation Records from InTune Service Graph Connector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2022 01:17 PM
We have multiple connectors for Discovery. InTune is returning software installation records and populating the software installation CI table. But... our data from InTune shows ALL installation records for a given application. Take Chrome for example. It shows the most current version installed as well as all previous versions for a given machine.
Any thoughts on how to, say, just keep the most recent version of an install after a nightly discovery? The SAM deduplication job is running... these are not duplicate records but different version records.
Table cleaner job that runs after InTune job filtered on InTune as the discovery source and then...? How do we get it to ditch everything but the most recent (or highest version number) record.
From a single machine in our CMDB. All records of Chrome discovered in InTune:
Or is there a better way to head this off at the Robust Transformer source for the InTune Graph Connector?
- Labels:
-
Service Graph
-
Service Graph Connector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2022 04:27 PM
I posed another question about getting install date or any more details on the install that could be used but I parsed through the entire message that connector is returning and that information is not being returned. Unfortunately it's very limited on the application installation information. So... trying a BR that compares version numbers and removing only the most recent version. Not ideal, but something...
(function executeRule(current, previous /*null when async*/ ) {
var maj, min, maint, build, verse, theNum, installSys, getSoft, currentMaj, currentMin, currentMaint, currentBuild, currentVersion;
currentVersion = current.version.split(".");
currentMaj = parseInt(currentVersion[0]) || 0;
currentMin = parseInt(currentVersion[1]) || 0;
currentMaint = parseInt(currentVersion[2]) || 0;
currentBuild = parseInt(currentVersion[3]) || 0;
getSoft = new GlideRecord('cmdb_sam_sw_install');
getSoft.addEncodedQuery('installed_on=' + current.installed_on + '^display_name=' + current.display_name);
getSoft.query();
while (getSoft.next()) {
theNum = getSoft.version.split(".");
maj = parseInt(theNum[0]) || 0;
min = parseInt(theNum[1]) || 0;
maint = parseInt(theNum[2]) || 0;
build = parseInt(theNum[3]) || 0;
if (currentMaj > maj) {
getSoft.deleteRecord();
} else if (currentMaj == maj && currentMin > min) {
getSoft.deleteRecord();
} else if (currentMaj == maj && currentMin == min && currentMaint > maint) {
getSoft.deleteRecord();
} else if (currentMaj == maj && currentMin == min && currentMaint == maint && currentBuild > build) {
getSoft.deleteRecord();
}
}
})(current, previous);
I'm not sure if this is the ideal way to check against versions; it seems there may be better ways under Tokyo with updated ECMAScript version availability.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2022 11:15 AM
A little update to this code. This does remove all lower install versions for a given machine on the software installation table successfully.
It is an async business rule on the table:
(function executeRule(current, previous /*null when async*/ ) {
var maj, min, maint, build, verse, theNum, installSys, getSoft, currentMaj, currentMin, currentMaint, currentBuild, currentVersion;
currentVersion = current.normalized_version.split(".");
currentMaj = parseInt(currentVersion[0]) || 0;
currentMin = parseInt(currentVersion[1]) || 0;
currentMaint = parseInt(currentVersion[2]) || 0;
currentBuild = parseInt(currentVersion[3]) || 0;
getSoft = new GlideRecord('cmdb_sam_sw_install');
getSoft.addEncodedQuery('installed_on=' + current.installed_on + '^display_name=' + current.display_name);
getSoft.query();
while (getSoft.next()) {
theNum = getSoft.normalized_version.split(".");
maj = parseInt(theNum[0]) || 0;
min = parseInt(theNum[1]) || 0;
maint = parseInt(theNum[2]) || 0;
build = parseInt(theNum[3]) || 0;
if (currentMaj > maj) {
getSoft.deleteRecord();
} else if (currentMaj == maj && currentMin > min) {
getSoft.deleteRecord();
} else if (currentMaj == maj && currentMin == min && currentMaint > maint) {
getSoft.deleteRecord();
} else if (currentMaj == maj && currentMin == min && currentMaint == maint && currentBuild > build) {
getSoft.deleteRecord();
}
//Updating table with new records with possible lower versions should delete itself:
if (currentMaj < maj) {
current.deleteRecord();
} else if (currentMaj == maj && currentMin < min) {
current.deleteRecord();
} else if (currentMaj == maj && currentMin == min && currentMaint < maint) {
current.deleteRecord();
} else if (currentMaj == maj && currentMin == min && currentMaint == maint && currentBuild < build) {
current.deleteRecord();
}
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 05:19 AM
I agree it is pain when it comes intune integration, how do you delete uninstalled software and why not use sys_object_source table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2024 09:37 AM
Hi, experiencing same issue than you. Did you find a better way than this BR? Thank you