ServiceNow Data Extraction Guide (for SIM Template)
The purpose of this document is to help ServiceNow administrators extract standardized software inventory data in a format that aligns with the Licenseware SIM Template. This enables seamless ingestion into Licenseware, where the data is automatically normalized, analyzed, and visualized for license optimization, compliance tracking, and software usage reporting.
Data Sources
ServiceNow stores hardware and software discovery data within its CMDB and SAM modules. The relevant data sources include:
-
CMDB CI (Configuration Items): Stores device and system data.
-
Software Installations [cmdb_sam_sw_install]: Records installed software linked to devices.
-
Software Model [cmdb_sam_sw_model]: Defines normalized application data, publisher, and license details.
-
ServiceNow REST API: Provides programmatic access to the same tables.
Prerequisites
For Console (UI) Method
-
Role:
asset_admin,sam_admin, or equivalent with read/export permissions. -
Access to CMDB or Software Asset Management modules.
-
Ensure that Discovery or IntegrationHub scans have populated software installation data.
-
Permissions to export list views or reports as CSV.
For API Method
-
A ServiceNow account with API access and read permissions for:
-
cmdb_ci_computer -
cmdb_sam_sw_install -
cmdb_sam_sw_model
-
-
Instance URL (e.g.
https://yourcompany.service-now.com/api/now/table/). -
A working PowerShell or curl environment for REST API queries.
Recommended Query or Method
Two main methods can be used to extract software inventory data suitable for SIM import.
Option 1: ServiceNow Console Export (UI)
This is the most straightforward method for most users.
Steps
-
Log in to your ServiceNow instance.
-
Navigate to Software Asset → Software Installations.
(Alternatively: open the tablecmdb_sam_sw_install.listdirectly.) -
Use the List View Configuration to display the following fields:
-
Installed On → Name (Device Name)
-
Software → Name (Software Name)
-
Software → Version
-
Software → Publisher
-
-
Apply filters as needed (e.g.,
Active = true,Discovery Source = ServiceNow). -
Once the list is displayed, click the List Menu (☰) → Export → CSV.
-
Save the file as
ServiceNow_SIM_Export.csv.
Tip: You can save this as a personalized view for recurring exports.
Option 2: ServiceNow REST API (Recommended for Automation)
For larger environments or automated reporting, use ServiceNow’s REST Table API.
Example PowerShell Script
# ServiceNow SIM Template Export Script
# Requires ServiceNow API credentials with read access to SAM tables
$Instance = "https://yourcompany.service-now.com"
$Username = "api_user"
$Password = "api_password"
$ExportPath = "C:\Exports\ServiceNow_SIM_Export.csv"
# Encode credentials
$EncodedAuth = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$Username`:$Password"))
$Headers = @{
"Authorization" = "Basic $EncodedAuth"
"Accept" = "application/json"
}
# Query Software Installations table
$Url = "$Instance/api/now/table/cmdb_sam_sw_install?sysparm_fields=installed_on.name,software.name,software.version,software.publisher&sysparm_limit=10000"
$Response = Invoke-RestMethod -Uri $Url -Headers $Headers -Method Get
# Process data
$ExportData = @()
foreach ($Record in $Response.result) {
$ExportData += [PSCustomObject]@{
"Device Name" = $Record.'installed_on.name'
"Software Name" = $Record.'software.name'
"Software Version" = $Record.'software.version'
"Software Publisher" = $Record.'software.publisher'
}
}
# Export to CSV
$ExportData | Export-Csv -Path $ExportPath -NoTypeInformation -Encoding UTF8
Write-Host "Export complete: $ExportPath"
For environments with more than 10,000 records, use pagination parameters such as
sysparm_offsetandsysparm_limit.
Exporting to CSV
-
Console Method:
Export directly from the list view as CSV (Export → CSV). -
API Method:
The PowerShell script generatesServiceNow_SIM_Export.csvautomatically.
The final CSV should have the following headers:
Device Name,Software Name,Software Version,Software Publisher
Preparing for SIM Import
-
Open the Licenseware SIM Template. 👉 Learn more here
-
Copy and paste the CSV content directly into the template, or use the Import from CSV function if available.
-
Verify that the columns align correctly:
-
Column A → Device Name
-
Column B → Software Name
-
Column C → Software Version
-
Column D → Software Vendor or Publisher
-
Ensure there are no blank header rows or extra delimiters before proceeding with upload to Licenseware.
Clean any duplicates or empty rows before saving.
Troubleshooting
| Issue | Cause | Resolution |
|---|---|---|
| Empty export | Discovery not populating the software installation table | Verify Discovery runs and the cmdb_sam_sw_install table contains recent data. |
| Missing publisher information | Software models not normalized | Run Normalization in SAM or enrich data manually before import. |
| 401 Unauthorized (API) | Invalid credentials or restricted role | Confirm the user’s role and reissue credentials. |
| Partial export (10k record limit) | Default ServiceNow API pagination limit | Use sysparm_offset to iterate through result pages. |
| Encoding/import issues | CSV not UTF-8 encoded | Re-save file with UTF-8 encoding. |
Example Output
Device Name,Software Name,Software Version,Software Publisher
WS-001,Google Chrome,129.0.6668.90,Google LLC
WS-002,Microsoft Teams,1.7.00.12345,Microsoft Corporation
SRV-03,Oracle Java SE Runtime Environment,8.0.411,Oracle Corporation
LAPTOP-15,Adobe Acrobat DC,24.002.20933,Adobe Inc.