Deploy Lookout at scale
Use this script with any tool that runs PowerShell as SYSTEM: an RMM, Intune, or a Group Policy startup script. It downloads the current Lookout release, checks Trimtab's signature on it, and installs it. You never need to edit the script for a new release.
On a device that's already enrolled, the script updates Lookout without using the key. That makes it safe to run on a schedule, so new devices get Lookout automatically.
The quickest way to get the script is from the Bridge: when you create an enrollment key on the Clients page, select Download deployment script to get a copy with that key already filled in. You can also download the script without a key, or copy it below, and set $EnrollmentKey yourself.
# Installs Trimtab Lookout. Run as SYSTEM from an RMM, Intune, or a Group Policy startup script; safe to run on a schedule.
# Guide: https://docs.trimtabsec.com/onboarding/deploy-at-scale/
# Set the client's enrollment key. Store it in your tool's secure variables where possible.
$EnrollmentKey = 'ek_your_key_here'
$ServerUrl = 'https://app.trimtabsec.com'
$ReleaseUrl = 'https://docs.trimtabsec.com/downloads/latest.json'
# Trimtab's release signing key (public). The script installs only packages signed with it.
$Modulus = '0gdSDsYKQwKD5XoRMB4hrf6bD21L4i4dhu+tlxcCqOHQEAxlTXoKZLtyD7JQfmdUrHwW94Tjjlms5qbMJKrDaCnaKXpuTIc6RFo37pQ3zG6F4DDH51nvSAeabmcMcKFsxXCNAIl2pgbKOpwQyzQN/OAtQ7EoR3Ew/qH45MvnabhlphKrP7bDF+gi46XMlnVPPfqSlytJvSoW1ZkT32fBVl0yGw9kjUQf/tkrWeGDWGgkJAJXROUCXp1pmQ7WqzXkWxTIhg6GZsw9pYWan+F6gx5+ZoftGKfw54lATxbXUoZ0pNVRvKv9HO1Ytkapr9QRYZ/tqhyhBCTCWxjz8e1vBpW56kjFFVZa8xze9JJ7PfByxmu+3TpCCV3TFwYsa6NHZ3ce1nDOCj1HV710G1uFRD+GQJDuWMjAzu4mSS8/9iAYerC/lGDDF+soEsiJyz9saxqoCKO38kHoaJQOvK1BL6Ih2vTvPK3nQ/azXDcccWMyfzKvpDlr1QO+9VyNXfRN'
$Exponent = 'AQAB'
$ErrorActionPreference = 'Stop'
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
$release = Invoke-RestMethod -Uri $ReleaseUrl -UseBasicParsing
$zip = Join-Path $env:TEMP 'trimtab-lookout.zip'
$dir = Join-Path $env:TEMP 'trimtab-lookout'
Invoke-WebRequest -Uri $release.url -OutFile $zip -UseBasicParsing
$bytes = [IO.File]::ReadAllBytes($zip)
$sha = [BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($bytes)).Replace('-', '')
if ($sha -ne $release.sha256.ToUpper()) { throw 'Checksum mismatch: the download is incomplete or corrupted.' }
$key = New-Object Security.Cryptography.RSAParameters
$key.Modulus = [Convert]::FromBase64String($Modulus)
$key.Exponent = [Convert]::FromBase64String($Exponent)
$rsa = [Security.Cryptography.RSA]::Create()
$rsa.ImportParameters($key)
$signed = $rsa.VerifyData($bytes, [Convert]::FromBase64String($release.signature),
[Security.Cryptography.HashAlgorithmName]::SHA256, [Security.Cryptography.RSASignaturePadding]::Pkcs1)
$rsa.Dispose()
if (-not $signed) { throw 'Signature check failed: this package was not signed by Trimtab. Nothing was installed.' }
Expand-Archive $zip -DestinationPath $dir -Force
$installer = Join-Path $dir 'agent\Install-ComplianceAgent.ps1'
if (Test-Path "$env:ProgramData\Trimtab\config.json") {
# Already enrolled: update Lookout and keep the device's registration.
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $installer
} else {
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $installer -ServerUrl $ServerUrl -EnrollmentKey $EnrollmentKey
}
Start-ScheduledTask -TaskName 'Trimtab Lookout Scan'
Remove-Item $zip, $dir -Recurse -Force -ErrorAction SilentlyContinue
One enrollment key covers all of a client's devices, so you need one key per client, not per device. See Enrollment keys.
- Create a new PowerShell component or script in your RMM.
- Paste the script above. Put the enrollment key in a site-level or client-level secure variable, and reference it instead of hard-coding it.
- Run it as SYSTEM against the client's Windows devices.
- Schedule it as a recurring job so new devices get Lookout automatically.
- In the Intune admin center, go to Devices → Scripts and remediations → Platform scripts → Add → Windows 10 and later.
- Upload the script with the client's key filled in.
- Set Run this script using the logged on credentials to No (runs as SYSTEM), Enforce script signature check to No, and Run script in 64 bit PowerShell Host to Yes.
- Assign it to a device group for the client.
- Save the script to a share that domain computers can read, such as
\\domain\NETLOGON\Trimtab. - Create a GPO linked to the client's computers.
- Go to Computer Configuration → Policies → Windows Settings → Scripts → Startup → PowerShell Scripts, and add the script.
- Devices install Lookout at their next restart.
After rollout
Watch the Fleet page fill in. Keep the key active while the script runs on a schedule, because new devices need it to enroll. If the key may have leaked, or you stop adding devices for that client, revoke it and, if you still need one, create a new key and update your RMM variable. Devices already enrolled keep working either way.
Using an older copy of this script?
Earlier versions of this page pinned a specific Lookout version and checksum. Those scripts keep working, because earlier packages stay published, but they install that older version and leave Lookout to update itself afterward. Replace them with the script above.