Install software using a custom client field (Bitdefender)

SentinelOne, Cove, DNSFilter etc.

Written By Mikel from Gorelo

Custom client fields can be used in scripts to install software with client specific info (keys, tokens etc.).

In this example, we'll use Bitdefender.

Step 1: Create the client custom field

  1. Navigate to Settings -> CRM-> Custom Fields

  2. Add custom field with the following details

    • Name: Bitdefender URL

    • Variable: bitdefenderURL

Step 2: Populate the 'Bitdefender URL' for each client

  1. Navigate to a specific Client

  2. Click on Custom Fields

  3. Edit 'Bitdefender URL'

  4. Enter the install exe URL retrieved from Bitdefender for each client

Bitdefender URL for the install exe should look like this (fake example):

https://cloudgz.gravityzone.bitdefender.com/Packages/BSTWIN/0/setupdownloader_[aHR0cHM6Ly9jbG91ZGdLWDawWVjcy5ncR5em9uZS5iaXRkZWZl3ddwawGfawdmRlci5jb20vUGFja2FnZXMvQlNUV0lOLzAvdkluc3RhbGxlci54bw-bGFuZz1lbi1VUw==].exe

Step 3: Create the script

  1. Navigate to Scripts

  2. Create a script with the following details:

    • Name: ➕Install-Bitdefender

    • Content:

Example
#$gorelo:client.bitdefenderURL # Check if Bitdefender is already installed if (Get-Service -Name "EPProtectedService" -ErrorAction SilentlyContinue) { Write-Host "Bitdefender is already installed. Skipping installation." exit 0 } # Proceed with installation $url = $gorelo:client.bitdefenderURL $filename = Split-Path $url -Leaf $installer = Join-Path $env:TEMP $filename Write-Host "Downloading Bitdefender installer..." (New-Object System.Net.WebClient).DownloadFile($url, $installer) Write-Host "Installing Bitdefender..." Start-Process -FilePath $installer -ArgumentList "/silent" -Wait Remove-Item -LiteralPath $installer # Verify installation Start-Sleep -Seconds 10 # Give the service time to start $service = Get-Service -Name "EPProtectedService" -ErrorAction SilentlyContinue if ($service -and $service.Status -eq "Running") { Write-Host "Installation successful! EPProtectedService is running." exit 0 } else { Write-Host "Installation may have failed. EPProtectedService not found or not running." exit 1 }

Step 5: Deploy the script via a policy

  1. Navigate to Policies

  2. Edit an existing policy that covers the assets you want Bitdefender installed on

  3. Add the '➕Install-Bitdefender' script and set to repeat daily at your preferred time

  4. Distribute the policy