OBLYTECH Logo
OBLYTECH Logo

File-based Discovery in ServiceNow: Finding Unregistered Software

File-based Discovery identifies software on Windows, UNIX and macOS devices by scanning configured folders for known file names and extensions, so software without a registration record can still be found. Matched files attach to the server’s configuration item during the exploration phase of a normal Discovery. The plugin must be activated first.

What the feature finds and what it is for

File-based Discovery works from files on disk instead of registration data. It compares what it finds with a library of known file signatures, which sharpens the picture of installed software and surfaces products that were not registered.

The output serves three jobs: software asset visibility, license management, and security review, where the feature helps detect forbidden or damaged files. For the wider scope, see the Discovery overview and what Discovery can find.

On the Brazil release, Windows versions 2008, 2008 R2, 2012 R2, 2016 and 2019, plus later versions, are supported with PowerShell 3.0 through 7. AIX 5.3, 6.1 and 7.1 and HP/UX 8.11 are also supported UNIX platforms. The UNIX probe is POSIX-compliant, so it is built to run on Linux and Solaris servers.

How a scan moves through a Discovery run

File-based Discovery runs inside a normal Discovery, during the exploration phase. Its probes search the configured paths for specific file extensions or file names and return the matches in the probe payload. The sensor then tries to match each file to an installed product, using the file name, size and version the probe returns against the known file signatures.

The first probe starts a background scanning process on the target. Later probes check its progress each time Discovery runs against that server, and they return results once the scan has finished. A scan started from Quick Discovery or a schedule returns nothing while the background scan is still running, so plan for that delay.

You can narrow each scan by folder, hidden-folder inclusion and file extension. Large scans, particularly on Windows estates, take a long time and load target CPUs. Windows scans also sleep at intervals to limit their load, and Discovery properties tune that throttle.

Windows and UNIX use different filtering paths

The signature lists differ greatly in size, so filtering happens in two places. The UNIX list is small enough to travel with the Unix – File Discovery probe, which filters directly on the target. The Windows list is larger and cannot run on the target. The Windows – File Discovery probe instead returns its matches to the MID Server, which filters them against the full Windows signature list and sends the file information back to the instance. A Windows scan therefore has one extra hop, and a healthy MID Server is part of the result path.

Where the results are stored

Four tables hold the output.

Table What it holds When it is populated
File Information (cmdb_file_information) Files found on a configuration item, matched or not Once a scan returns results
Software Installation (cmdb_sam_sw_install) Software products identified from matched files When Software Asset Management Professional (SAMP) is active
Unidentified File Set (cmdb_unidentified_file_set) Files that could not be matched to a product When a file fails matching
Swid Tags (cmdb_swid_tag) Software identification tag data When SWID tag scanning is enabled

The File Information table is the main one to open. Its default view shows path, product, publisher, size, software installation and version, and the records appear as a related list on the computer record. Version is populated for Windows files. On Linux and UNIX the probe returns just the file name and size, so that field stays empty. Linux software versions come from the rpm and dpkg based probes, such as Linux – Install Software.

Software asset management, unmatched files and SWID tags

With SAMP active, a matched file does more than sit in a table. The product and publisher are written into the file record, the software installation record is created or updated, and matched package licenses are updated. Without SAMP, the feature still records files but creates no software installation records.

Files that normalization cannot match go into the Unidentified File Set. You can add publisher, product, version, edition, platform and language to each record. Once a product and publisher are supplied, the SAMP settings can use that file for matching in future discoveries.

SWID tag scanning is a separate switch in the Discovery Configuration Console. When it is on, SWID tag information fills the Swid Tags table, and each record links to its software installation. On UNIX and Linux servers, a Base64 package is a prerequisite. Enable it selectively for products that ship valid SWID tags to keep scanning overhead contained.

Activating the feature and setting the schedule

The File-based Discovery plugin, com.snc.discovery.file_based_discovery, is required for file signature filtering. It is included with a Discovery subscription, but activation has to be requested, and it brings the Software Asset Management – File Signature Normalization plugin with it. Enabling and configuring the feature requires the admin role. For the general Discovery setup, see the Discovery setup guide.

The feature is off by default to avoid performance impact on existing customers. To enable it, open the Discovery Configuration Console. The Common section sets the maximum number of files to discover, and raising it can affect performance.

The frequency sets how often each configuration item is scanned, with Monthly as the default. More frequent intervals are not recommended, given the performance cost. After a scan returns file information for a configuration item, the feature waits for the interval to expire before scanning that target again. Scans do not trigger until the initial Content Data Service synchronization completes, which can take about 24 hours.

Windows script signing and antivirus

The Windows scan runs a PowerShell script, filebaseddiscovery.ps1, supplied as a probe parameter. It is signed with the ServiceNow publisher certificate, so add that publisher to your trusted publisher repository. If your execution policy requires your own certificate, or you change the script, re-sign it and paste the updated file back into the probe parameter.

Permissions and tools on target hosts

File-based Discovery connects with the configured discovery credential and reads files as that account. Directories and files the account cannot read are skipped without an error. On Windows, access follows the NTFS permissions of the credential’s account, reached through WinRM and WMI. Working files go to the admin$ share, by default under the Windows temp directory.

On UNIX and Linux, the discovery user needs read and execute (traverse) on the scan-path directories, read on the matching files, and read and write on the temporary directory, /tmp by default. When SWID scanning is enabled, it also needs read on the SWID files. The Linux scan covers /opt and /etc, and directories the account cannot read there are skipped.

The UNIX probe also needs standard tools in the system path: find, wc, awk and grep; ps and nohup; sh or bash; and sed, cat, mv, rm, chmod, tr and head. With SWID scanning on, base64 or uuencode must be present too, and the probe tries uuencode first. On Ubuntu 20, point the default Bourne shell (sh) at Bourne Again shell (bash) before scans will run.

PowerShell 7 hosts and the Brazil release

The Australia release did not support File-based Discovery on Windows hosts running PowerShell 7, and scans on those hosts failed with a cmdlet-not-recognized error. The Brazil release supports PowerShell 7 hosts through two MID Server parameters, and the instance must be on Brazil to use them.

Install PowerShell 7 on the MID Server and on each target. On each PowerShell 7 target, set DisableImplicitWinCompat to true in the PowerShell configuration file. Without it, PowerShell 7 loads some modules through a background Windows PowerShell 5.1 session, which blocks Discovery scripts.

The two parameters are mid.powershell.prefer_7_plus, for the MID Server, and mid.powershell.prefer_7_plus_remote, for the target host. Both default to false, and a host without them runs PowerShell 5. To create them, go to All, then MID Server, then Servers, select the server, and on the Configuration Parameters tab choose New for each one.

Troubleshooting setup problems

Symptom First check
“File Discovery data not yet synced” message Let the initial Content Data Service sync finish, which can take about 24 hours.
Feature not triggered during Discovery Confirm the feature is enabled and the scan interval is not set too long.
File-based timestamps show 1970 Content has not downloaded yet. Open each Download Schedules record for samp_file_name, samp_file_map and samp_file_set and select Execute Now.
MID Server log errors from the file discovery filter Confirm the file-based discovery inclusion list exists in the agent work folder inside the MID Server installation folder. A missing list means the sync failed.
PowerShell errors on Windows Add the ServiceNow publisher to the trusted publisher repository and confirm antivirus exclusions are in place.

To confirm a download, check the Outbound HTTP Requests log for a 200 response from the ServiceNow data service. If the inclusion list is missing, use the file discovery filter refresh related link on the MID Server record.

Frequently asked questions

Does File-based Discovery need a registration record to find software?

No. The feature is built for servers where registration information is missing. It matches the name, size and version returned by its probe against known file signatures.

Where do I see the files the feature found on a server?

Open the File Information table, or the related list on the computer record.

What happens to a file the feature cannot match?

It goes into the Unidentified File Set. Supplying a product and publisher lets SAMP settings use that file in future matching.

Do I need Software Asset Management Professional to get useful results?

Without SAMP, the feature still records discovered files, but it creates no software installation records and updates no licenses. For those records and license updates, SAMP needs to be active.