Reference: Variables and advanced customization
Each OS bundle contains a list of key value pairs, which are settings that control the flow or processing of the OS bundle itself. In addition to the predefined settings listed in Provision key value pair options, you can also add custom variables. These custom variables are not used by the default Tanium Provision scripts, but they can be combined into variables that are used by the scripts, or they can be used in your own scripts.
Provision key value pair options
The following key value pair options are configurable in OS bundles. The key value pairs support variable substitution. For example, %manufacturer% in the ComputerName key might be changed to Dell Inc.
If you want to prompt for a user to enter or select values for any keys instead of configuring set values, see Prompt for information during deployment.
|
Key |
Description |
|---|---|
|
AdminPassword |
The password for the local Administrator account.
Note: -%serial% is automatically appended to the end of the password.
Important: Disable the built-in local Administrator account or change the local Administrator account password after Tanium provisions the endpoint. If you use the ODJ service, the provisioned endpoint automatically disables the local Administrator account after it successfully joins the domain.
|
|
BitLocker |
(Windows) A value to enable BitLocker drive encryption during pre-provisioning, prior to the OS image being applied. If the value XTS-AES-256 is specified, the encryption level is set to that value before initializing BitLocker encryption on the device. Any other value encrypts the drive using the default XTS-AES-128 encryption. If a value is not specified, BitLocker pre-provisioning is not performed and the drive is unencrypted.
Note: This value enables BitLocker drive encryption but does not configure key protectors. After OS deployment, use a BitLocker management tool, such as Tanium Enforce, to configure BitLocker. A management tool helps create and store recovery keys in escrow before enabling key protectors.
|
|
ComputerName |
The computer name is set to the value that you specify. You can also use variable substitution, such as TAN-%rand:10% to generate a name with ten random digits, or more complex names like A-%manufacturer:3%-%serial:-5% to generate a name where the first three characters of the manufacturer are inserted with the last five characters of the serial number.
Tip: Do not use this format for virtual machines.
If a value is not specified, the computer name is randomly generated. For more information, see Read-only variables. |
|
DirectDownload |
(Windows) A JSON string of properties to download Windows system OS image files directly from Microsoft. For more information, see Download Windows files directly from Microsoft.
Note: You still need to upload a WIM file in the OS image WIM section of Create a Windows OS bundle to save the bundle. You can upload a dummy WIM file.
|
|
DomainName |
(Windows) If an ODJService value is specified, specify the domain to join. |
|
ImageIndex |
(Windows) Overrides the WIM image index set in the OS bundle. Set this variable in the Customer-PE-Pre.ps1 custom script or through a custom Bundle WebService to select a different image index at deployment time. The value must be a positive integer greater than or equal to 1. For more information, see Include custom scripts. |
|
Migrate |
(Windows) For an OS refresh, specify no to skip the USMT capture/restore. |
|
ODJAppend |
(Windows) Enter false to not add a numeric suffix to the specified computer name. If the computer name already exists, the ODJ request fails with an error. |
|
ODJDC |
(Windows) Specify the domain controller to use when creating the new computer. Enter the CN of the domain controller, for example, DC01 and not DC01.domain.com. |
|
ODJRetries |
(Windows) Specify the number of times to try to create the new computer object. |
|
ODJService |
(Windows) The URL of the ODJ service. For example, if you enable the ODJ service on an endpoint that is named myServer.myDomain.com, then the ODJ URL is https://myServer.myDomain.com:myPort/getblob. If a value is not specified, domain join is not performed. |
|
Offline Domain Join: CertTemplate |
(Windows) Specify this key with the name of the certificate template to use when generating a new certificate in the ODJ blob for the computer. For more information, see (Optional) Add certificates and group policy templates.
Note: You cannot override the Offline Domain Join: CertTemplate value with settings from an external web service. For more information about web services, see Get settings from an external web service.
|
|
Offline Domain Join: IncludeRootCerts |
(Windows) Specify this key with a value of 1 to include root certificates in Active Directory in the generated ODJ blob. For more information, see (Optional) Add certificates and group policy templates. |
|
Offline Domain Join: PolicyNames |
(Windows) Specify this key to the list of group policy objects to include in the ODJ blob for the computer. For more information, see (Optional) Add certificates and group policy templates.
Note: You cannot override the Offline Domain Join: PolicyNames value with settings from an external web service. For more information about web services, see Get settings from an external web service.
|
|
OS Refresh: UseTaniumClient |
For OS refresh bundles, specify this key with a value of Yes to download files with the Tanium Client instead of from the Provision Endpoint. For more information, see Download OS refresh files with the Tanium Client. |
|
OU |
(Windows) If an ODJService value is specified, specify the OU where you want the device to be created, such as OU=MyComputerOU,DC=myDomain,DC=com. If a value is not specified, the default OU is used.
Important: Do not use double quotes.
|
|
RebootAndRerun |
Manually specify this variable to restart and rerun the Customer.ps1 script as many times as necessary. For more information, see Example: Restart and rerun the Customer.ps1 script. |
|
Tags |
A comma-delimited list of tags to be added to the Tanium Client during the deployment process. If a value is not specified, only an OSD tag is added. |
|
Timezone |
(Windows) A Windows time zone string, such as Eastern Standard Time to be set on the endpoint. |
|
WaitFor |
The Provision process waits for all WaitFor conditions to be met before executing customer.ps1 or finishing the Provisioning process. The following values are supported, and you can define multiple values separated by the pipe ( | ) character:
For example, the following WaitFor value forces a reboot, then waits for Deploy tools and Patch tools to install, and then waits for AnyConnect.exe to be installed in the specified path: Reboot|CX|C:\Program Files\Cisco\AnyConnect.exe |
|
WebService |
Manually specify this key to define web service calls prior to customizing OS bundle values. For more information, see Get settings from an external web service. |
|
WebServicePost |
Manually specify this key to define web service calls after customizing OS bundle values. For more information, see Get settings from an external web service. |
Read-only variables
The following read-only OS bundle variables are automatically defined at the start of the Provision process.
|
Variable |
Description |
|---|---|
|
anchor |
The URL of the Tanium PXE server that is currently in use. |
|
asset |
The asset tag of the computer. |
|
architecture |
The architecture of the computer/OS. Example: X64, X86, or ARM64 |
|
chassis |
The string representing the chassis type. Example: DESKTOP, LAPTOP, or SERVER |
|
chassis_type |
The chassis type that is specified by WMI/DMI for the machine. Example: 3 for desktop, 8 for laptop, or 23 for server |
|
ExecutionPass |
The number of times the Customer.ps1 script ran. This variable is automatically incremented by one each time the script is called. For more information, see Example: Restart and rerun multiple times. |
|
is_desktop |
Set to true if the device is a desktop (based on chassis_type). |
|
is_laptop |
Set to true if the device is a laptop (based on chassis_type). |
|
is_server |
Set to true if the device is a server (based on chassis_type). |
|
manufacturer |
The manufacturer of the computer or virtual machine. Example: LENOVO |
|
model |
The model of the computer or virtual machine. Example: Latitude E5400 |
|
refresh |
When set to true, specifies a refresh deployment. The existing OS is wiped and a new OS is applied. |
|
serial |
The serial number of the computer. |
|
uefi |
Specifies whether the computer is using UEFI (true) or not (false). |
|
uuid |
The SMBIOS UUID (a GUID that uniquely identifies the device, assigned by the manufacturer) of the computer. |
|
version |
The version field from SMBIOS, which is often a friendly name for the specified computer model, typically on Lenovo computers. Example: ThinkStation P620 (where the model is 30E0CTO1WW) |
Prompt for information during deployment
If you want to prompt for values during the deployment process, click Prompt when you add a key value pair. You can then enter additional details such as label, optional help text, and select the input type which supports simple text input, dropdown lists, and checkboxes. Depending on which input type you select, you can configure the following options:
-
Text:
-
(Optional) Max Characters: The maximum number of characters allowed in the input.
-
(Optional) Validation Expression: A regular expression that defines the acceptable parameters of the input. If the user input does not match the pattern, the deployment does not continue.
-
-
Dropdown:
-
(Required) Values: The options available in the list.
-
-
Checkbox: (no additional options)
Additionally, if you select the Dropdown input type, you can select the Enable multiple value selection option to allow for multiple selections. If you want to allow only a single selection, do not select this option.
Change the display order of bundles in the PXE boot menu
By default, OS bundles are listed in alphabetical order by bundle name in the PXE boot menu. You can change the default sort order in the Settings .
For more information, see Configure OS bundle behavior.
Get settings from an external web service
Provision supports getting settings through the ability to call one or more web services. These web services can take the information that is provided and return a list of additional settings or override existing settings. The following web service settings are supported:
-
Web Service URLs global setting: called prior to the display of the OS bundle list in the Tanium Provision wizard.
Note:To automatically select a specific OS bundle, use the BundleID and BundleTimeout variables. Variable names are case-sensitive.
-
BundleID: The OS bundle ID to automatically select in the Tanium Provision wizard if the user does not click Choose before the BundleTimeout expires. To find the ID, go to the OS Bundles page and click Additional Data
next to the OS bundle.
-
BundleTimeout: The time to allow a user to manually select an OS bundle before the specified BundleID is automatically selected. To enable the automatic selection of an OS bundle, you must specify a value greater than 0.
-
-
WebService bundle variable: called after selecting an OS bundle, but before any customization prompts.
-
WebServicePost bundle variable: called after the customization prompts, which enables calculations of other variables based on values that are entered by the user during customization.
These web services are specified by their URL, and the URL can contain variables. Both GET and POST methods are supported by specifying the method as a prefix to the URL. If no prefix is specified, then GET is the default method.
For a GET request, any available variable can be provided to the web service as a query parameter in the URL, so you must explicitly specify each value that the web service requires.
For a POST request, all current variables are passed to the web service as a JSON-encoded body.
Example: Two web services
If you want to call two web services, you can specify a WebService setting as follows:
https://myServer/GetSettings?model=%Model%;POST https://myServer/DoProcessing
Example: Static file
Because a web services is basically a web request that returns a JSON response, you can also use static files that are returned by a GET request. If you specify a WebService URL of https://myServer/%Model%.json and the model of the current endpoint is Virtual Machine, then Provision makes a GET request to https://myServer/Virtual Machine.json. If the web server contains a file by that name, then you can put settings in that file. For example, you can specify that all virtual machines get a specific time zone as follows:
{
"TimeZone": "GMT Standard Time"
}
Download Windows files directly from Microsoft
For Windows bare metal or OS refresh deployments, the content for that deployment is downloaded from the Tanium PXE service, which runs on a corporate network. For deployments over the internet or in situations where the connection to the internet is faster than the connection to the Tanium PXE service, you can alternatively configure Provision to download the Windows OS system image file directly from the Microsoft Windows Update servers.
Before you begin
Ensure that you meet the following prerequisites:
-
You must use an updated ADK_<architecture>.zip file that was generated using the latest ADKPrep.ps1 script.
-
Unauthenticated outbound Internet access to *.download.windowsupdate.com on TCP port 80 and content.tanium.com on TCP port 443 is required. If content filters, proxies, firewalls, or other security hardware or software are used to restrict Internet access in your environment, your security administrator might need to allow access.
Configure direct download
To configure direct download, modify or configure an OS bundle and specify the properties that tell Provision which OS image to download and apply.
-
From the Main menu, go to > OS Bundles.
-
In the Key Value Entries section, click Add Key Value Pair and select DirectDownload from the Key dropdown list.
-
For the Value field, enter the example JSON string: {"build":"<build>","arch":"<architecture>","lang":"<language>","edition":"<edition>"} where:
-
build specifies the Windows build number (example: 19044 is Windows 10 21H2 or 22000 is Windows 11 21H2)
-
arch specifies the machine architecture (x64, x86, or a64)
-
lang specifies one of the available Windows language codes (example: en-us)
-
edition specifies the edition from the downloaded image file (example: Pro, Enterprise, or Education)
For example, {"build":"22000","arch":"x64","lang":"en-us","edition":"Enterprise"} tells Provision to automatically download the most recent image that matches the build, architecture, and language. The edition is then used to find the appropriate image index within that image: 64-bit Windows 11 21H2 Enterprise for English CPUs.
Note: You still need to upload a WIM file in the OS image WIM section of Create a Windows OS bundle to save the bundle. You can upload a dummy WIM file.
-
-
After the deployment is complete, verify the image properties.
-
To verify which image was downloaded, check the download.log file.
-
To verify which image index was selected, check the provision-pe.log file.
-
If any errors occurred while attempting to find a direct download image, Provision automatically uses the image that is specified in the OS bundle.
Download OS refresh files with the Tanium Client
During OS refresh deployments, you can configure endpoints to use the Tanium Client to download the files instead of downloading them directly from the Provision Endpoint.
To configure endpoints to use the Tanium Client for downloads, modify or configure an OS bundle and specify the OS Refresh: UseTaniumClient key value pair.
-
From the Main menu, go to > OS Bundles.
-
In the Key Value Entries section, click Add Key Value Pair.
-
For the Key field, select OS Refresh: UseTaniumClient.
-
For the Value field, enter Yes.
Include custom scripts
You can include custom scripts to call automatically during the provisioning process. You can create a ZIP file that contains at least one PowerShell script file for any custom Windows content that you want to include. The main Provision scripts download and extract the contents of the ZIP file (if specified in the OS bundle) into the C:\_t folder, and then automatically run any PowerShell scripts, if found.
If you need to include a reboot in a script, use the RebootAndRerun variable instead of a command. For reboot examples, see Example: Restart and rerun the Customer.ps1 script and Example: Restart and rerun multiple times.
Use one or more of the following script names, depending on when you want your scripts to run:
-
Customer-PE-Pre.ps1 - called at the start of the Windows PE phase, prior to applying the OS image
-
Customer-PE.ps1 - called at the end of the Windows PE phase, after applying the OS image, injecting drivers and updates, and placing the unattend.xml in place (prior to restarting into Windows)
-
Customer-Pre.ps1 - called at the start of the Windows configuration process in the new Windows OS, but prior to installing the Tanium Client or joining the device to Active Directory or Azure AD
-
Customer.ps1 - called at the end of the Windows configuration process, as the last action before completion. If anti-tamper is enabled, the <Tanium_Client> directory is read-only. Ensure that any commands that you add to the customer1.ps1 script do not attempt to write to this directory.
Example: Load the TaniumOSD or TaniumClient modules
The script can load the TaniumOSD or TaniumClient modules:
Import-Module C:\_T\TaniumOSD
Import-Module C:\_T\TaniumClient
The Provision logs automatically capture a transcript of the output from the custom script.
The TaniumOSD module includes a variety of cmdlets, including some that are useful to work with variables:
-
Get-OSDVariable -Name "variableName"
-
This cmdlet returns the current value of the specified variable.
-
-
Resolve-OSDVariables -Value "This is a %model% computer from %manufacturer%."
-
This cmdlet returns the current value of the specified string, substituting the current values of any variable references in that string.
-
-
Set-OSDVariable -Name "variableName" -Value "my value"
-
This cmdlet sets the specified variable to the provided value.
-
-
Set-OSDProgressDisplay -Message "Currently installing something..."
-
This cmdlet changes the on-screen progress display so that the user knows what is currently happening.
-
The TaniumClient module also includes some useful cmdlets:
-
Add-TaniumTag -Tag "tagName"
-
This cmdlet adds a tag with the specified name.
-
-
Invoke-TaniumDownload -URL "https://server.com/path/file.zip" -Destination "C:\file.zip"
-
This cmdlet uses the Tanium Client API to download a file from the specified URL and then moved to the specified destination.
-
Example: Restart and rerun the Customer.ps1 script
If you need to run the Customer.ps1 script multiple times, followed by a restart each time the script is run, you can set the RebootAndRerun variable to true:
Set-OSDVariable -Name "RebootAndRerun" -Value $true
Example: Restart and rerun multiple times
If you need to restart and rerun the script multiple times, you can set the RebootAndRerun variable each time the script runs. This value is automatically cleared by the restart process. If you need to keep track of which time the script is running, you can use the ExecutionPass variable, which is incremented by one each time the script runs.
The following example script runs a command after the initial restart:
Import-Module C:\_T\TaniumOSD
Import-Module C:\_T\TaniumClient
$pass = Get-OSDVariable -Name "ExecutionPass"
switch ($pass) {
1 {
Write-Host "Nothing to do in the first pass; schedule a second pass."
Set-OSDVariable -Name "RebootAndRerun" -Value $true
}
2 {
# Set computer description
$computerDescription = Get-OSDVariable -Name "ComputerDescription"
Write-Host "Second pass; setting computer description to $computerDescription."
& net.exe config server /srvcomment:"$computerDescription"
}
}
Join endpoints to Microsoft Entra ID
You can join endpoints to Microsoft Entra ID (Azure Active Directory), instead of the local Active Directory. You specify the Entra ID instance when you add a Microsoft provisioning package zip to an OS bundle.
Provision automatically applies the provisioning package during endpoint imaging. The provisioning package joins endpoints to Entra ID at first boot. When provisioning is done, users sign into the endpoints with their Entra ID accounts.
-
Create a Microsoft provisioning package that specifies the Entra ID. For more information, see Microsoft documentation: Create a provisioning package.
-
Zip the provisioning package. Confirm the .ppkg file is located at the root of the zip.
-
Create a Windows OS bundle. In the Scripts and Other Files section, select the zip. In the Key Value Entries section, do not add DomainName, ODJService, or OU key value pairs.
Use Windows Autopilot deployment for existing devices
You can use Provision with Windows Autopilot to reinstall the Windows operating system on existing devices.
Be aware that if you include an Autopilot profile JSON, the Provision processes change:
-
Provision does not install Tanium Client. You must include Tanium Client in the WIM file or deploy the Client through Microsoft Intune.
-
Domain join is not performed.
-
Custom scripts Customer-pre.ps1 and Customer.ps1 do not run.
To use Windows Autopilot, you need to upload a JSON file for Autopilot profiles when you create an OS bundle.
-
Create a JSON file for Autopilot profiles. For more information, see Microsoft documentation: Windows Autopilot deployment for existing devices: Create JSON file for Autopilot profiles.
-
Create a Windows OS bundle. In the Scripts and Other Files section, select the JSON file.
Tip: If necessary, change the Format type to All Files when browsing for the file.
Cache OS bundle content
When using a Provision Endpoint, content caching is advantageous in situations where the endpoint is at a location with very limited bandwidth or is connected over a metered network connection (such as a satellite).
When the content caching feature is enabled, the Provision Endpoint first copies the files in the <Tanium Client>\Tools\Provision\precache folder to the cache folder. Then, the Provision Endpoint downloads any missing files from Tanium, while honoring any configured bandwidth throttles.
To prestage content to the precache folder to reduce network traffic, complete the following steps:
-
On each Provision Endpoint where precaching is desired, create a <Tanium Client>\Tools\Provision\precache folder.
-
From an existing Provision Endpoint, go to the <Tanium Client>\Tools\Provision\cache folder.
-
Copy the files named with SHA-256 hashes and paste to the <Tanium Client>\Tools\Provision\precache folder on each Provision Endpoint from Step 1.
-
If the files being precached are already assigned to this Provision Endpoint, restart the TaniumPXE service to load the files from the precache folder.
Bootloader variants for PXE boot
Select the NX or non-NX bootloader that a Provision Endpoint serves for PXE boot.
When an endpoint PXE boots, the Provision Endpoint serves a first-stage bootloader (shimx64.efi for x64 and shimaa64.efi for Arm64) that starts GRUB. The bootloader is available in two variants:
- NX: Marked as compatible with the memory protections that some endpoint firmware enforces. Endpoints with stricter firmware, such as the Microsoft Surface Laptop 8 for Business, require this variant.
- Non-NX: Not marked as compatible with those memory protections. This variant works on endpoints whose firmware does not enforce the strict memory protections. This variant does not start on firmware that requires NX. Before Endpoint Configuration Toolset 2.44, Non-NX was the default.
Only one variant is active at a time. The Provision Endpoint reads the Provision.ShimVariantX64 and Provision.ShimVariantARM64 Tanium Client settings when the TaniumPXE service starts and serves the matching bootloader. Each architecture is selected independently.
The following table shows the default bootloader for each architecture.
| Architecture | Default variant | Reason |
|---|---|---|
| x64 | NX | Supports endpoints that require NX firmware compatibility. |
| Arm64 | Non-NX | The Arm64 boot image does not support NX. |
The following table shows the values that you can set for each architecture.
| Setting | Value | Bootloader served | When to use |
|---|---|---|---|
| Provision.ShimVariantX64 | Not set | Default (NX) | Normal operation. |
| nonx | shimx64-nonx.efi | x64 endpoints do not reach GRUB with the default bootloader. | |
| nx | shimx64-nx.efi | Same as the default. Usually not needed. | |
| Provision.ShimVariantARM64 | Not set | Default (non-NX) | Normal operation. |
| nonx | shimaa64-nonx.efi | Same as the default. Usually not needed. | |
| nx | shimaa64-nx.efi | Not supported. Causes error: bad shim lock signature. |
Values are not case-sensitive. A change takes effect after you restart the TaniumPXE service, applies only to the Provision Endpoint where you make the change, and does not change the bootloader in bootable USB or ISO media.
If an endpoint fails to boot after a bootloader change, see the following troubleshooting topics: