Collecting Additional Fields
PCAnalyser collects a fixed set of hardware and software fields. Some products keep licensing information outside that set. Examples are a license key in the registry, a client ID or a value in a vendor's configuration file. The /settings switch adds fields of your own. It needs no new agent version and no change on the server.
Setup Steps
- Place a file named
pcasettings.iniin the same folder aspcanalyser.exe - Add
/settingsto the PCAnalyser command line - Each
[Section]in the file becomes one extraSectionName=valueline in the PCA file - The first time a value arrives, the data loader adds a matching column to the Network Discovery holding table automatically
- Map the new column to an asset field or specification field, like any other discovery field. Then load the files with Load Now on the Discover tab of the Discovery Dashboard. Its label shows how many files are waiting.
Without /settings the file is ignored. Without the file, /settings does nothing. Neither changes any of the standard fields, so existing discovery is unaffected.
For logon-script and manual discovery the executable runs from the Collection Server share. Place the file once, next to the executable, and add /settings to the command line:
\\<collectionserver>\pcanalyser\pcanalyser.exe /enc /flags 535 /idle /settings
For laptops running the installed agent, see Deploying PCAnalyser as an Agent. The switch is already on there. The deployment script copies the file beside the exe.
The Settings File
The file is a plain text INI file (ANSI, UTF-8 or Unicode). Lines starting with a semicolon or # are comments. Keywords are not case sensitive.
Section names become SQL column names, so they must be letters and digits only and must not start with a digit. A section that finds nothing writes no line. If the product is not installed, the column stays empty.
Every section takes an optional MaxLength (1 to 1000, default 255). Values are trimmed and control characters are removed before they are written.
Type=REG -- a registry value
| Keyword | Meaning |
|---|---|
Hive |
HKLM (default), HKCU, HKCR or HKU |
Key |
The subkey path. End it with \* to read the value from every subkey one level down; the results are joined with a bar |
Value |
The value name. Leave empty for the key's default value. String and DWORD values are supported |
View |
32 or 64 to force a registry view. Omit for the operating system default, which is the 64-bit view on 64-bit Windows. Products installed as 32-bit applications keep their keys in the 32-bit view |
; Xshell keeps its key under a version-numbered subkey, so \* picks it up whichever version is installed
[NetSarangXshellKey]
Type=REG
Hive=HKLM
Key=SOFTWARE\NetSarang\Xshell\*
Value=ProductKey
View=32
[TeamViewerClientID]
Type=REG
Hive=HKLM
Key=SOFTWARE\TeamViewer
Value=ClientID
View=32
Type=WMI -- a WMI property
| Keyword | Meaning |
|---|---|
Namespace |
Defaults to root\cimv2 |
Query |
A WQL query |
Property |
One property name. Multiple instances are joined with a bar |
[BiosAssetTag]
Type=WMI
Query=SELECT SMBIOSAssetTag FROM Win32_SystemEnclosure
Property=SMBIOSAssetTag
Type=FILE -- a value inside a text file
| Keyword | Meaning |
|---|---|
File |
Full path. Environment variables such as %ProgramData% are expanded |
After |
The value starts after the first occurrence of this text. Omit to start at the beginning of the file |
Before |
The value ends at this text. Omit to stop at the end of the line |
[SomeProductLicence]
Type=FILE
File=%ProgramData%\SomeVendor\license.txt
After=LicenceKey=
Before=;
MaxLength=100
Using the Collected Values
Once loaded, the value appears in the Network Discovery holding table under the section name. Map it to an asset field or a specification field, then load it with Load Now. A license key in a specification field can be reported next to the recognized software title. This lets you match a product bought by department (NetSarang, TeamViewer) by the installed key, as well as by title and version.
A sample file covering NetSarang Xshell, Xftp and Xmanager and TeamViewer is supplied with the agent as pcasettings-sample.ini.
Related Articles
- Manual Discovery and Logon Scripts -- where the command line is set
- The PCAnalyser Folder -- the folder that holds the file
- Loading Discovery Data -- mapping the new column
- Deploying PCAnalyser as an Agent -- the installed agent for laptops