Categories
PowerShell Tanium

Hijack the Tanium End User Notification Tools

Let’s face it; interacting with user space from the System context is not always the easiest thing to do in the Windows world. There are a lot of hacky, inconsistent, frustrating ways to get the job done but I want things to be simple. I want a common format, basic images, some basic button functionality, and rock-solid reliability.

I recently worked with my fantastic DTAM, Pedro Castro, on implementing a custom package to deploy notifications to the current logged-in user of an endpoint by leveraging an Action from the console. This content is fantastic as is but it got me thinking: what about the times when I need to invade user space with client-side tooling/scripts? What about scenarios where I need to dynamically determine the message/buttons depending on the context of the system/user space at scale? Can a similar approach be utilized to deliver my oh-so-important commentary directly to the eyeballs of my customers?

As it turns out, the answer is an emphatic YES and it is far simpler than I imagined it would be.

The End User Notification Tools for the Tanium Endpoint Management platform are typically leveraged by things like app and patch deployments that require user interactive messaging. The default installation directory of those tools is as follows:

C:\Program Files (x86)\Tanium\Tanium End User Notification Tools

There are a variety of files within this directory but the one we’re going to be leveraging for this task is named client-ui-launcher.min.vbs. client-ui-launcher.min.vbs is capable of parsing a specifically-formatted XML file in order to present a message to the active user session of the Windows endpoint.

There are two general approaches to the formatting depending on the type of message you need to generate.

For a Notice (No reboot/postponement/etc.), use the following structure in your XML file(s):

<Notification id="999999999">
<type>notice</type>
<allowPostpone>false</allowPostpone>
<deadline>2099-11-29 23:20:30Z</deadline>
<title>Include Notification Title Here</title>
<icon>data:image/png;base64,PUTYOURHILARIOUSLYLONGBASE64ENCODEDIMAGEHERE</icon>
<body>Include Notification Message Here</body>
<bodyImage>data:image/png;base64,PUTYOURHILARIOUSLYLONGBASE64ENCODEDIMAGEHERE</bodyImage>
</Notification>

For a Restart (Reboot/Postponement Options) message, use the following structure in your XML file(s):

<Notification id="999999999">
<type>restart</type>
<allowPostpone>false</allowPostpone>
<deadline>2099-09-22 22:20:30Z</deadline>
<countdownToDeadlineInMinutes>5</countdownToDeadlineInMinutes>
<gentleNotificationDurationInMinutes>1</gentleNotificationDurationInMinutes>
<userPostponementPeriodInMinutesOne>1</userPostponementPeriodInMinutesOne>
<userPostponementPeriodInMinutesTwo>120</userPostponementPeriodInMinutesTwo>
<userPostponementPeriodInMinutesThree>1440</userPostponementPeriodInMinutesThree>
<title>Include Notification Title Here</title>
<icon>data:image/png;base64,PUTYOURHILARIOUSLYLONGBASE64ENCODEDIMAGEHERE</icon>
<body>Include Notification Message Here</body>
<bodyImage>data:image/png;base64,PUTYOURHILARIOUSLYLONGBASE64ENCODEDIMAGEHERE</bodyImage>
<useTaniumClientTimeZone>true</useTaniumClientTimeZone>
</Notification>

Keep in mind; you can have as many custom XML files as you deem necessary to accomplish whatever task you are trying to accomplish. If your use case requires a potential of 10 messages, create 10 XML files (Or dynamically build your XML files with PowerShell at runtime ^_^) and use your scripting logic to dynamically select whichever one is appropriate.

All that is left to do now is to pass the XML file to the client-ui-launcher.min.vbs referenced earlier. The command to do that is very simple:

cmd /c cscript "C:\Program Files (x86)\Tanium\Tanium End User Notification Tools\client-ui-launcher.min.vbs" "/File:YOURNOTIFICATIONFILE.xml"
You’re the Captain now.

Disclaimer: Any code made available on this site is free to use at your own discretion but it is provided without any explicit or implied guarantees of support, reliability, or functionality. I accept no responsibility in the event that the code, in its original form or any derivative versions thereafter, malfunctions or causes problems . Anything from this site that you decide to work with should be tested thoroughly in development environments in collaboration with your Technical Account Manager (TAM) until such time that you, the responsible party, decides that you are satisfied with its outcomes.