Enabling full memory dump on Windows systems

Tanium Client installation using a Group Policy Object (GPO)

Warning

Warning: This tool generates an Immediate Scheduled Task GPO.

If you link this GPO at the domain root, all domain-joined computer objects install the Tanium Client on the Next Policy Refresh.

Do not perform this operation in production unless you are absolutely sure you want this to happen.

The more common scenario here would be to either link at the OU level, or to set up item-level targeting or security group filtering prior to linking the GPO (at domain root or OU level), or both.

See the Appendix for more information on granular targeting of GPOs in this way. 

Overview

Background and Context

Deployment of the Tanium Client requires local administrative privileges. The Active Directory Software Installation Group Policy Object (GPO) for computers executes as part of the endpoint startup, and hence is limited to physically connected domain computers, or computers that have a pre-logon authenticated Virtual Private Network (VPN) client such as Windows Server Always On VPN. It is also reliant on the application installer being available as an MSI file.

This document presents a potential solution that can be applied to VPN-connected computers that do not have pre-logon connection, and additionally does not require those computers to be restarted to apply the GPO as it is applied by immediate scheduled task on next policy refresh. The entire process is fully automated, by using a tool that has been developed internally to automatically generate both the GPO itself, and the client installer script that is launched on next policy refresh. It is also fully compliant with Azure AD Domain Services (AADDS) environments, and in such a way that you do not have to stand up a management server 24 x 7 to host the files. 

Tool and process

The tool configures the client installer script launched by the GPO on the fly, to inject the domain FQDN, optionally configure client settings, and to optionally add custom tags automatically. The tool can be used both interactively, for ad-hoc on-demand generation of the GPO and client installer script, whereby these options are presented to the user to configure directly in the console, or non-interactively for use in wider endpoint build processes, by configuring these settings using optional parameters.

Full error-trapping has been built into the tool so that only valid values for these settings are accepted, as well as to ensure the environment it is being run on is appropriate, for instance that the endpoint is domain-joined, and that the user can import the generated GPO, and can write to the requisite folder. The results of every operation the tool attempts are logged into a TaniumGPO.log file in the same folder the tool was run from for offline analysis, and to facilitate troubleshooting.

Once everything has been successfully validated, the tool creates and imports the immediate scheduled task GPO, automatically customized for the FQDN of the domain it is being run on. It generates a customized batch script file, based on the installer switches you configured, if applicable, and any custom tags you added, and writes it to a folder in the SYSVOL share, together with the Tanium Client installer files SetupClient.exe and tanium-init.dat.

The tool can also optionally link to domain root, if you want to apply the Tanium Client to all computer objects in the domain. Alternatively, you can link the GPO manually afterwards, for instance for granular targeting at OU level, or for security group filtering or item-level targeting.

Once the GPO has been successfully imported and linked, and the files written to the appropriate folder, all domain-joined computers in scope for targeting run the generated batch script on next policy refresh. The script determines if the client is already running, and instantly exits if so. Otherwise, it installs the Client, with the switches you configured as applicable, then add any custom tags you included. 

Requirements

This tool requires the following components:

Using the Tanium Deployment GPO Generator tool

Prerequisites and environment validation

Download the tool that contains the automated installer script, see the Tanium Deployment GPO Generator tool.

Ensure you have saved the Tanium Client installer files SetupClient.exe and tanium-init.dat into the same folder as the Tanium Deployment GPO Generator.ps1 script before you run it.

Whether you launch the tool interactively or non-interactively, the first thing it does is validate that the environment you are running in is appropriate to perform the actions it needs to. Any of the following conditions result in an immediate terminating error:

  • Not domain-joined

  • SetupClient.exe or tanium-init.dat files are not found in the launch folder

  • Unable to write to the SYSVOL Scripts folder (for on-premises domains where the NETLOGON share is available) or policies folder (for AADDS domains where there is no NETLOGON share)

  • Unable to import the PowerShell Group Policy module, usually because either the endpoint is not a domain controller or does not have RSAT for GPMC installed, or because of permissions

These conditions are all tested then the run terminated if at least one fails, so you can identify and resolve them all if there is more than one. Examples of the errors you may encounter are described in the "Appendix" on page 1. 

Interactive mode

To use the tool interactively, right-click it and select Run with PowerShell from the context menu:


Graphical user interface, text, application Description automatically generated

Once the validation checks complete successfully, you are prompted for values of the following optional variables. None of these need to be configured if not required, you can press Enter to accept installation defaults, except the final prompts for linking the GPO at domain root, which require a Y or N response:

  • Override the server address(es) declared in the tanium-init.dat file, comma-delimited, no spaces.

  • Override default server port 17472. Accepts integer values only.

  • Override default Tanium Client log verbosity level of 1. Accepts 0, 41 or 91 only.

  • Custom tag values, space-delimited, for example, tag1 tag2 tag3.

  • Override default name for the GPO of Tanium Client deploy, for example, to comply with naming conventions, etc.

  • Automatically link the GPO to domain root

    • If you enter Y to this prompt, a warning appears reminding you of the implications of doing so, together with a further confirmation prompt. Reminder: For your own safety, please refer to the warning at the start of this document.

Default values are assumed for all variables not explicitly declared.

The prompts for variable values are all validated before continuing:


interactivemode

Invalid entries force you to enter a valid response. See the "Appendix" on page 1 for example error messages for invalid responses.

Note that if you declare you want to link the GPO at domain root, and a link already exists for the specified (or default) GPO name, it asks if you want to keep the pre-existing link or “force a re-link”, which deletes the pre-existing link and create a new one:


Using_the_Tanium_Deployment_2_738x37

It then confirms the values being used and prompt you to confirm they are correct, which requires a Y or N response:


Graphical user interface Description automatically generated
 

Non-Interactive mode

The tool can be used non-interactively, for example in wider build processes or scripts. In order to use the tool in this way, the command-line parameter -silent must be appended to the launch command, together with, minimally, the -executionpolicy bypass parameter in order to allow script execution to run. However, the tool also supports additional parameters for control of all the variables that can be configured interactively:

Parameter name

description

ServerAddress

Overrides the server address(es) declared in the tanium-init.dat file, comma-delimited, no spaces.

ServerPort

Overrides default server port 17472. Accepts integer values only.

LogLevel

Overrides default Tanium client log verbosity level of 1. Accepts 0, 41 or 91 only.

Tags

Custom tag values, space-delimited in quotes. For example, -Tagstag1 tag2 tag3

GPOName

Overrides default name for the GPO of Tanium Client deploy. For example to comply with naming conventions, etc. Use quotes if the name includes spaces.

LinkGPO

Switch parameter, no value. It automatically links the GPO to domain root, but does not delete a pre-existing link. If the link already exists, it generates an error.

ForceLinkGPO

Switch parameter, no value. It automatically links the GPO to domain root, and does delete a pre-existing link. If the link does not already exist, it automatically reverts to -LinkGPO functionality.

LinkGPOConfirmation

Switch parameter, no value. It is a mandatory additional switch if -LinkGPO or -ForceLinkGPO are set, to confirm you understand the implications of doing so. Reminder: For your own safety, please refer to the warning at the start of this document.

Note: Default values are assumed for all parameters not explicitly declared.

The same initial checks are performed when running the tool non-interactively as interactively, and the same validation checks are performed against the arguments passed in non-interactive parameters as those passed interactively. If one or more arguments is invalid, or an invalid parameter name is detected, it fails. The tests and results are presented in the console and logged in the TaniumGPO.log file, as per interactive mode, so that even if you cannot see the console you can analyze the log file.


non-interactivemode_powershell

See the "Appendix" on page 1 for examples of the errors returned for invalid parameter arguments. 

Post-validation operations

Once the entries are validated and confirmed, the tool automatically performs the following operations:

  • Checks if the destination folder for the GPO launch script and Tanium Client installer files exists, and creates it if not.

    • The path to the destination folder is automatically customized for your domain FQDN. For domains with on-premises domain controllers (DCs) the folder is a subfolder within \<FQDN>\NETLOGON; for AADDS domains the folder is created within \<FQDN>\SYSVOL\FQDN>\Policies - this is the folder that contains AADDS GPOs, so by writing the files here you do not need to keep a management server online 24x7 to host them.

    • Using FQDN rather than specifying a specific server name also promotes load balancing for environments with multiple DCs.

    • The destination folder is automatically named <GPO Name> - files and automatically substitutes invalid filename characters that may be found in the GPO name.

  • Copies the Tanium Client installer files SetupClient.exe and tanium-init.dat files to the destination folder.

  • Generates a batch script file customized to the destination folder path and any command-line installation switch overrides you configured, and including additional lines to write the registry values for any tags you defined.

  • Creates and imports an immediate scheduled task GPO customized to the domain FQDN.

  • (Optionally) deletes any pre-existing GPO link at domain root, as applicable, and (re-)links it.

  • Performs SYSVOL/GPO replication to any other DCs that may be present in the domain.

  • Housekeeping to remove the temporary subfolder created in the system Temp folder when the GPO was created

The entire process run end-to-end can be seen in the screenshots below:


Text Description automatically generated

Text Description automatically generated

If you take a look at the generated batch script, you see it contains your command-line switch overrides, together with the lines to add the custom tags to the registry. Again, you can check this in the TaniumGPO.log file once the console window closes, as well as the file itself in the destination folder:


Graphical user interface, text Description automatically generated

Results

If you open GPMC, you see the generated GPO in the Group Policy Objects folder, and the link at domain root if it is applied:


Graphical user interface, text, application Description automatically generated

If you go to the GPO settings, you see the details for the generated immediate scheduled task:


Graphical user interface, text, application, email Description automatically generated

If you go to the \\FQDN>\NETLOGON share (for on-premises Domain Controllers) or the \<FQDN>\SYSVOL\FQDN>\Policies folder (for AADDS domains) you see the subfolder <GPO Name> - files contains the SetupClient.exe, tanium-init.dat and generated TaniumClient.cmd files:


Graphical user interface, text, application, email Description automatically generated

Appendix

Granularized targeting

In cases where you do not want to target an entire domain or entire OU(s) – this often is the case in production – you can configure more granularized targeting for the GPO before you link it. The two main ways to do this are with Security Filtering and Item Level Targeting.

Security filtering

First of all, in Active Directory Users and Computers, create a security group that contains the computer objects you want to deploy the Tanium Client to, then add the computer objects to it.


Graphical user interface, text, application, email Description automatically generated

Once the group is created and populated, in the Security Filtering section of the Scope tab for the GPO, delete the default Authenticated Users by clicking it then clicking Remove, then OK to the dialogue that appears:


Graphical user interface, text, application, email Description automatically generated

Graphical user interface, text, application Description automatically generated

Now click the Add button and add the security group you just created:


Graphical user interface, text, application Description automatically generated

Graphical user interface, text Description automatically generated

It is a good idea to ensure the group has the correct privileges. Go to the Delegation tab, click the Advanced button, select your security group and ensure that Allow privileges for Read and Apply Group Policy are checked:


Graphical user interface, text, application Description automatically generated

You can now safely link the GPO at domain root/OU level, and only the computer objects in the security group will apply it and install the Tanium client on next policy refresh.

Item-level targeting

If security group membership does not allow for the level of granularity required for your use case, you can be much more specific in your targeting by use of GPO Item-Level Targeting. In order to configure this, you need to edit the immediate scheduled task the GPO launches directly by following these steps:

  1. Right click the GPO and select Edit.


    Graphical user interface, text, application Description automatically generated
  2. In the Group Policy Management Editor navigate to Computer Configuration > Preferences > Control Panel Settings > Scheduled Tasks, then double click your Tanium deploy task.


    Graphical user interface, text, application Description automatically generated
  3. Go to the Common tab and select the Item-level targeting check box, then click the Targeting button.


    Graphical user interface, text, application, email Description automatically generated
  4. The Targeting Editor appears. If you click the New Item menu item top left, you see a large variety of options you can use to specify exactly which computer objects you want to target with the GPO.


Graphical user interface, text, application Description automatically generated

For more information on item-level targeting, and how to configure each option, refer to the Microsoft article.

Like Security Filtering, once the item-level targeting is configured, you can safely link the GPO at domain root/OU level, and only the computer objects that fulfill your targeting criteria apply it and install the Tanium Client on next policy refresh.

Immediate and silent GP Update with Specops GPUpdate

When testing this model, it is useful to be able to apply an immediate GP update rather than waiting for the next automated policy refresh. While it is possible to force a GP update within GPMC, by right-clicking an OU and selecting Group Policy Update, this model firstly adds a randomization time of up to ten minutes, plus on every endpoint you can see a command box whilst the update is running.

Specops offer a free utility that can perform a GP update immediately and silently, across an OU, specific computers, or an entire domain. You can download it from the Specops website.

Troubleshooting

The screenshots below detail failures from the initial environment check when the tool is first launched, in both Interactive and Non-Interactive mode, from the console and the TaniumGPO.log file. You can see a non-domain joined machine, the Tanium Client setup files not found, the Group Policy PowerShell module import failing, and failure to write to the necessary SYSVOL share folder. If any of these errors occur, perform the necessary remedial steps to ensure the environment you’re running the script from fulfils the requirements set out in the requirements section above.


A screenshot of a computer Description automatically generated with medium confidence

A screenshot of a computer Description automatically generated with medium confidence

Text Description automatically generated

Graphical user interface, application Description automatically generated with medium confidence

The screenshots below detail examples of invalid entries being entered (Interactive Mode) or passed through via parameter arguments (Non-Interactive Mode) for the optional parameters. You can see a non-integer value for the server port, an entry for log verbosity level that is not 0, 41 or 91, and additionally, in Interactive Mode, an invalid entry for the GPO link prompt, and in Non-Interactive Mode, the -LinkGPO parameter is set with no corresponding -LinkGPOConfirmation parameter, and where the link already exists at domain root, and an invalid parameter name. You need to enter, or pass through via parameter, valid responses to each option, as described above, to continue:


A picture containing text Description automatically generated

Text Description automatically generated

Text Description automatically generated