Tanium Content: Supplementing BGInfo and Other Tools

Tanium Content: Supplementing BGInfo and Other Tools

Background

In a recent Tanium customer training, one attendee asked about the future of BGInfo and the possibility of Tanium providing similar capabilities if BGInfo becomes unusable. This was related to a discussion on the possible future deprecation by Microsoft of VBScript and Windows Management Instrumentation (WMI).

The question was clearly related to the use of Microsoft-owned SysInternals BGInfo, a tool often used by Windows server administrators or end user computing support to place messages on the Windows wallpaper to give information to users on login. Typically, this information is somewhat static, including many predefined values such as computer name, operating system version, IP address, serial number and more.

Official Microsoft announcements are the source of truth for Microsoft products and support life. Our understanding at the time of this writing, is that:

  • VBScript changes are planned, with the ability at some time to uninstall and possibly future versions of Windows may not have VBScript installed.

  • WMI is unaffected, but the command line tool WMIC is deprecated.

  • The PowerShell cmdlet Get-WMIObject is deprecated in newer versions of PowerShell (i.e. PowerShell 7, installed as pwsh under Program Files directories), but is still available everywhere PowerShell 5 and earlier versions are installed, and can still be used by PowerShell 7, as long as PowerShell 5 modules are accessible via the $env:PSModulePath environment setting.

Impact

BGInfo also provides the ability to use alternate means of showing other custom fields, among them the use of WMI, VBScript, reading file contents and more. Clicking the Custom… button while configuring BGInfo, we can see the additional options, including WMI queries and VBScript which allows selection of a script to be executed to populate the custom field.


1

2

We can’t speak to specifics without additional documentation not shown in detail on Microsoft sites related to BGInfo (https://learn.microsoft.com/en-us/sysinternals/downloads/bginfo), but it is safe to assume that Microsoft is deprecating VBScript for security and other reasons and after VBScript becomes unavailable, any customized fields will no longer function as designed. There may be alternate options in the form of an open source VBScript project; however open source code comes with its own drawbacks and Tanium does not advise using open source alternatives to VBScript.

WMI custom fields are unlikely to be affected by Microsoft deprecating WMIC. Fully compiled BGInfo code is almost certainly using .NET or other libraries making API calls directly to WMI.

It is also reasonable to assume, though not guaranteed, that the Microsoft team responsible for SysInternals tools might release an updated version that removes the VBScript and possibly WMI custom options, and potentially instead provide a PowerShell custom alternative.

Alternatives to BGInfo and Custom Scripts

The possible deprecation of BGInfo and subsequent discussion in the training led to the following questions:

  • Does Tanium have or plan to provide an alternative to BGInfo?

  • Can Tanium help with providing the types of information previously provided using a custom VBScript?

Tanium has several solutions that could be applied as solutions to these questions in creative ways. For example, you could use Tanium Engage with end user surveys or End User Notifications (EUN) typically used by Tanium Deploy and Tanium Patch; however, these are not primary intended use cases for those Tanium modules. As fully compiled code, BGInfo should continue to run with all existing standard fields.

How can Tanium help customers using BGInfo to continue providing the information currently available using those custom fields dependent on VBScript and possibly WMI that may at some time be unavailable? Tanium platform packages are a good alternate solution. Using a custom platform package as an example, we will show how the standard BGInfo field Internet Explorer version (which for most users should not be relevant any longer) can be easily replaced with custom code to report the current Microsoft Edge version. This can be adapted to any browser or any other information that can be queried using standard tools or scripting languages available on Windows.

Consider the following PowerShell code which uses a standard PowerShell module / cmdlet to retrieve software information, in this case installed using the Appx technology:

CODE
Get-AppxPackage -Name Microsoft.MicrosoftEdge.*

This example intentionally looks for MicrosoftEdge.*, because different versions of Edge might be reported, specifically Edge.Stable, or others if using Beta pre-release test versions.

Taking this example a little further, the useful information needed is likely to be limited to the specific Edge application name and version number. While many different approaches to selecting fields, formatting output and storing it in a file, the example below shows one possible approach:

CODE
Get-AppxPackage -Name Microsoft.MicrosoftEdge.* | Select-Object Name,Version | Format-Table -HideTableHeaders | Out-File 'C:\Program Files (x86)\Tanium\Tanium Client\Tools\MyCustomerData\EdgeVer.txt'

Notice that this example is not only retrieving the values of interest, but also writing them to a text file stored in a suggested customer specific location inside the Tanium client directory. Be careful when creating files and additional directories to avoid the possibility of using Tanium standard locations, or directory names that might be used by, and conflict with Tanium content.

This can be easily tested and refined using any PowerShell prompt, PowerShell_ISE, or for example Visual Studio code with PowerShell execution integration.

Notice that this example is not only retrieving the values of interest, but also writing them to a text file stored in a suggested customer specific location inside the Tanium client directory. Be careful when creating files and additional directories to avoid the possibility of using Tanium standard locations, or directory names that might be used by, and conflict with Tanium content.

This can be easily tested and refined using any PowerShell prompt, PowerShell_ISE, or for example Visual Studio code with PowerShell execution integration.


3

Again, multiple possible techniques are available, but notice that the example above includes the name Microsoft.MicrosoftEdge.Stable. For briefer display via BGInfo on the wallpaper, we could extend this by using PowerShell text replacement capability before writing to file. For example, to remove the first Microsoft only, or both and simply return Edge and a version number, include a PowerShell text replacement:

CODE
-replace "Microsoft.Microsoft","Microsoft"
CODE
-replace "Microsoft.Microsoft",""

Now with the required text able to easily be written to file, having this run automatically to detect updated Edge versions would also be useful. Turn the code above into a Tanium platform package, either as a PowerShell .ps1 script file invoked by an action using PowerShell -File <filename.ps1>, or possibly as a single inline instruction using PowerShell -Command “<script code>”

An important point to remember also is that the Tanium client runs in a 32-bit context, so some PowerShell modules and cmdlets may not be available. Special techniques may be necessary to access 64-bit capabilities, though these techniques should be avoided if possible and alternate WMI or CIM techniques used instead.

With a package created and ready to test, (also as a best practice be sure to verify the output directory location exists before attempting to write a file), a scheduled action can be easily created. Decide how often updates might be required, the same way we create sensors using Tanium’s maximum data age. The less frequently an action needs to run, the better. Daily, weekly, possibly multiple times daily depending on the frequency of change expected in the custom field information can be easily scheduled. Of course, the package can also be an ad hoc, single execution action targeting specific computers at any time.

The final step for BGInfo would of course be to configure the newly created custom value. Run BGInfo and open the configuration file, typically named something like BGInfo-config.bgi. Remember this is not a simple text file. It includes binary values. It should only generally be modified using BGInfo or other techniques, not using a text editor to avoid corrupting it.

  1. Click Custom....

  2. Click New.

  3. Choose a name for the new custom field then select the radio button Contents of a file.

  4. Browse to the location of the file and click OK.


    5

The new custom field becomes available for selection in the BGInfo fields panel and can be added to the configuration for display.


6

All that remains is to distribute the modified BGInfo configuration to targeted computers and set BGInfo to update on the required schedule, typically using Windows Task Scheduler for example, at system boot, user login, and maybe specific intervals as desired.

This example can be adapted and modified to almost any situation or custom field and demonstrates the capability and flexibility of the Tanium platform to adjust to unforeseen changes in the sysadmin software availability landscape.

Conclusion

While Tanium does not provide an alternative to BGInfo, different Tanium solutions can be used to communicate with users. We have shown here that for many, the technique of using a Tanium platform package, standard core capabilities may be a good alternative to replace existing custom fields using VBScript with a Tanium managed solution to retrieve any information using a PowerShell script.

The Internet Explorer / Microsoft Edge example script and techniques described are not intended to be complete and all-inclusive, the intent of the example is to demonstrate how some potentially simple custom code can be used together with Tanium clients and other third-party software such as BGInfo to provide additional functionality.

If you are not yet licensed for Tanium Engage and have not seen the capabilities of the module, ask your Tanium sales and support team to arrange a demonstration or deep dive with a subject matter expert and consider a proof-of-concept temporary license so you can test and see the value of the module in your own environment.