Collecting Additional Fields
PCAnalyser collects a fixed set of hardware and software fields. Some products keep information that matters for licensing outside that set -- a licence key stored in the registry, a client ID, a value in a vendor's configuration file. The /settings switch lets you add fields of your own without a new version of the agent and without any change on the server.
How It Works
- 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 in Discover > Load Now, like any other discovery field
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, so the file only has to be placed once, next to the executable, and /settings added 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 and the file is copied beside the exe as a step in the deployment script.
The Settings File
The file is a plain text INI file (ANSI, UTF-8 or Unicode). Lines starting with ; 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 produces no line at all, so a product that is not installed costs nothing and leaves the column 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\licence.txt
After=LicenceKey=
Before=;
MaxLength=100
Using the Collected Values
Once loaded, the value is available in the Network Discovery holding table under the section name and can be mapped in Load Now to an asset field or a specification field. A licence key mapped to a specification field can then be reported alongside the recognised software title, which is how a product bought by department (NetSarang, TeamViewer) is reconciled by the key actually installed rather than by title and version alone.
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 -- where the file lives
- Loading Discovery Data -- mapping the new column
- Deploying PCAnalyser as an Agent -- the installed agent for laptops