Skip to main content

Snow Inventory Agent Script - Collect custom registry keys 4

Here you can find the release notes for Snow Inventory Agent Script - Collect custom registry keys 4.


4.2.0 latest

Release date: 2024-08-21

COMPATIBLE VERSIONS

Snow Inventory Agent for WindowsMicrosoft PowerShell
5 or later3 and later

INFORMATION

The Scan-CustomRegistry.ps1 script improves the out-of-the-box functionality of the Snow Inventory Agent for Windows and allows the inventory of additional registry keys without interfering with the default registry keys queried by the Agent itself.

The script must be executed as part of the Snow Inventory Agent for Windows, according to the topic Running PowerShell scripts as part of the scanning process on Snow Docs. Otherwise the results will not be included in the snowpack.

In the case that you want to run a manual scan, this script must be executed with appropriate permissions, so execute it using only sc.exe control SnowInventoryAgent5 128, as described in the Windows Agent - Command line topic on Snow Docs.

For debugging purposes, the script can be executed manually and supports common parameters, so you will receive detailed Logs using the command Scan-CustomRegistry.ps1 -Debug -InformationAction 'Continue'.

Function

The script requires a keys.csv file to be present in the same folder as the script. The file needs to be semicolon separated and requires the header key;property;lognotfound, that needs to be part of that file.

kpv.png

key
property
  • property to look for
ognotfound (optional)
  • This column is optional. It accepts the values true and false. If set to true, the script will report a <CustomRegKey> with the key set to HKEY_LOCAL_MACHINE\SOFTWARE\Snow Software\Scan-CustomRegistry[Key number] and
    • if the key is not present: The property set to the requested and the the value as key not found
    • if the property is not present: The property set to the requested and the value as property not found
Example keys.csv
key;property;lognotfound
HKLM:\SOFTWARE\7-Zip;TestName;true
HKLM:\SOFTWARE\7-Zip;Path64;false
Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Powershell\*\PowershellEngine;PowerShellVersion;false
HKCU:\SOFTWARE\TeamViewer;MRU;true
HKLM:\SOFTWARE\DaxStudio;ExcelBitness;true
HKLM:\SOFTWARE\Snow Software\Inventory Provider\*;NextScheduledRun;true

This script scans for the keys and properties using Get-ItemProperty. They will be included in the Agent snowpack as &#60;CustomRegKey&#62;. They also will be included as &#60;Software&#62; using the key as pathName, property as manufacturer and value as name, so custom software recognition rules can be created to handle them.

MediumIntegrity

This script does not need medium integrity to access most registry keys. If you require that functionality, the #MediumIntegrityLevel comment needs to be added to the script and the script needs to be resigned with a valid signature.

Troubleshooting

Not all users have access to all keys. If you receive Requested registry access is not allowed messages. Try to elevate.

Depending on the registry keys to query, custom encryption might need to be applied in Snow Inventory Agent for Windows prior to version 7, as it will not be executed in medium integrity.

NEW

  • Found registry values will also be reported as <Software> rows.

FIXED

  • When a property is not found, and the lognotfound option is set to true, the script now returns property not found correctly.
  • When a key is not found, and the lognotfound option is set to true, the script now returns key not found correctly.

DEPRECATED

  • There will be no encrypted snow-ps1 version of this script provided by Snow Software

4.1.0

Release date: 2024-05-08

COMPATIBLE VERSIONS

Snow Inventory Agent for WindowsMicrosoft PowerShell
5 or later3 and later

INFORMATION

The Scan-CustomRegistry.ps1 script improves the out-of-the-box functionality of the Snow Inventory Agent for Windows and allows the inventory of additional registry keys without interfering with the default registry keys queried by the Agent itself.

The script must be executed as part of the Snow Inventory Agent for Windows, according to the topic Running PowerShell scripts as part of the scanning process on Snow Docs. Otherwise the results will not be included in the snowpack.

In the case that you want to run a manual scan, this script must be executed with appropriate permissions, so execute it using only sc.exe control SnowInventoryAgent5 128, as described in the Windows Agent - Command line topic on Snow Docs.

For debugging purposes, the script can be executed manually and supports common parameters, so you will receive detailed Logs using the command Scan-CustomRegistry.ps1 -Debug -InformationAction 'Continue'.

Function

The script requires a keys.csv file to be present in the same folder as the script. The file needs to be semicolon separated and requires the header key;property;lognotfound, that needs to be part of that file.

image-20240418-101522.png

key
property
  • property to look for
lognotfound (optional)
  • This column is optional. It accepts the values true and false. if not present or set to true, the script will report a registry key with the key HKEY_LOCAL_MACHINE\SOFTWARE\Snow Software the desired property and the value property not found.
Example keys.csv
note
key;property;value
HKLM:\SOFTWARE\7-Zip;TestName;true
HKLM:\SOFTWARE\7-Zip;Path64;false
Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Powershell\*\PowershellEngine;PowerShellVersion;false
HKCU:\SOFTWARE\TeamViewer;MRU;true
HKLM:\SOFTWARE\DaxStudio;ExcelBitness;true
HKLM:\SOFTWARE\Snow Software\Inventory Provider\*;NextScheduledRun;true

This script scans for the keys and properties using Get-ItemProperty. They will be included in the Agent snowpack as &#60;CustomRegKey&#62;.

MediumIntegrity

This script does not need medium integrity to access most registry keys. If you require that functionality, the #MediumIntegrityLevel comment needs to be added to the script and the script needs to be resigned with a valid signature.

Troubleshooting

Not all users have access to all keys. If you receive Requested registry access is not allowed messages. Try to elevate.

Depending on the registry keys to query, custom encryption might need to be applied in Snow Inventory Agent for Windows prior to version 7, as it will not be executed in medium integrity.

CORRECTIONS

  • File encoding changed to UTF-8-BOM to prevent HashMismatch errors (04771125).

DEPRECATED

  • There will be no encrypted snow-ps1 version of this script provided by Snow Software

4.0

Release date: 2024-02-08

COMPATIBLE VERSIONS

Snow Inventory Agent for WindowsMicrosoft PowerShell
5 or later3 and later

INFORMATION

The Scan-CustomRegistry.ps1 script improves the out-of-the-box functionality of the Snow Inventory Agent for Windows and allows the inventory of additional registry keys without interfering with the default registry keys queried by the agent itself.

The script must be executed as part of the Snow Inventory Agent for Windows, according to the topic Running PowerShell scripts as part of the scanning process on Snow Docs. Otherwise the results will not be included in the snowpack.

In the case that you want to run a manual scan, this script must be executed with appropriate permissions, so execute it using only sc.exe control SnowInventoryAgent5 128, as described in the Windows Agent - Command line topic on Snow Docs.

For debugging purposes, the script can be executed manually and supports common parameters, so you will receive detailed logs using the command Scan-CustomRegistry.ps1 -Debug -InformationAction 'Continue'.

Function

The script requires a keys.csv file to be present in the same folder as the script. The file needs to be semicolon separated and requires the header key;property;lognotfound, that needs to be part of that file.

&quot;Illustration of keys

key
property
  • property to look for
lognotfound (optional)
  • This column is optional. It accepts the values true and false. if not present or set to true, the script will report a registry key with the key HKEY_LOCAL_MACHINE\SOFTWARE\Snow Software the desired property and the value property not found.
Example keys.csv
note
key;property;value
HKLM:\SOFTWARE\7-Zip;TestName;true
HKLM:\SOFTWARE\7-Zip;Path64;false
Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Powershell\*\PowershellEngine;PowerShellVersion;false
HKCU:\SOFTWARE\TeamViewer;MRU;true
HKLM:\SOFTWARE\DaxStudio;ExcelBitness;true
HKLM:\SOFTWARE\Snow Software\Inventory Provider\*;NextScheduledRun;true

This script scans for the keys and properties using Get-ItemProperty. They will be included in the agent snowpack as &#60;CustomRegKey&#62;.

MediumIntegrity

This script does not need medium integrity to access most registry keys. If you require that functionality, the #MediumIntegrityLevel comment needs to be added to the script and the script needs to be resigned with a valid signature.

Troubleshooting

Not all users have access to all keys. If you receive Requested registry access is not allowed messages. Try to elevate.

Depending on the registry keys to query, custom encryption might need to be applied in Snow Inventory Agent for Windows prior to version 7, as it will not be executed in medium integrity.

NEW

  • Snow Inventory Agent for Windows 7 support.
  • The script is now signed by Snow Software AB.

DEPRECATED

  • There will be no encrypted snow-ps1 version of this script provided by Snow Software

Flexera does not own the third party trademarks, software, products, or tools (collectively, the "Third Party Products") referenced herein. Third Party Product updates, including user interface updates, may not be reflected in this content.