You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remmediate Licensing for non - Licensable Software Installs
2
+
3
+
This repository contains a ServiceNow server-side script designed for a data cleanup operation related to Software Asset Management (SAM) installations. The script targets and updates specific records on the cmdb_sam_sw_install table to maintain data accuracy.
4
+
Note: This is a working workaround for a bug in Servicenow XANADU SAM application.
5
+
6
+
Overview
7
+
The primary purpose of this script is to ensure that software installations identified as non-licensable do not retain normalized product or publisher information. This prevents these specific records from being included incorrectly in SAM reconciliation and reporting. By clearing the normalization fields on these non-licensable items, the script improves data quality and the integrity of software asset reporting.
8
+
9
+
Key functions
10
+
Targeting non-licensable records: The script uses an encoded query to find all software installation records that have a populated norm_product field, but whose associated product record is not marked as licensable.
11
+
12
+
Clearing fields: It specifically clears the norm_product and norm_publisher fields on all matching records.
13
+
14
+
Performance optimization: The script is designed for bulk operations and optimizes performance by disabling business rules and workflows (gr.setWorkflow(false);) during the update process.
15
+
16
+
Usage
17
+
This script is intended to be executed in a ServiceNow instance, typically as a:
18
+
19
+
Fix Script: A one-time execution for a specific data cleanup task.
20
+
Scheduled Job: Can be scheduled to run periodically to maintain data consistency over time.
21
+
22
+
Important considerations
23
+
Backup: As with any data manipulation script, it is highly recommended to test the script thoroughly in a sub-production environment first. Running it on production data should be done with a prior backup or on a limited set of records initially.
24
+
Performance: The updateMultiple() method is used for efficiency. The setWorkflow(false) call prevents unnecessary business rule execution and significantly improves performance during large batch updates.
25
+
Dependency: The script relies on the Software Asset Management (SAM) Normalization feature being active, as it targets fields populated by that process.
0 commit comments