CoCoineticCoinetic for MSPs

Deploy Coinetic AI Security with ConnectWise Automate / RMM

For MSPs and IT teams that manage Windows Servers and PCs with ConnectWise Automate or ConnectWise RMM: one PowerShell script installs Coinetic AI Security silently, takes each customer's license key from a variable or task parameter, and hands back an exit code your RMM can act on.

In short
  • One script for both tools. It contains the placeholder @CoineticKey@, which your RMM fills with the customer's license key - the key never sits in the script.
  • Run it as SYSTEM. Exit code 0 = done.
  • Computers that already have Coinetic AI Security are skipped; it updates itself, so no update job is needed.

Who this is for

IT service providers and administrators who use ConnectWise Automate or ConnectWise RMM and want Coinetic AI Security on many Windows Servers and PCs without touching each one. For Group Policy, Intune or any other RMM tool, see the general deployment guide.

What the script does

  1. Checks that it runs as SYSTEM or administrator and that Windows is supported.
  2. Skips computers that already have Coinetic AI Security (exit code 0) - the installed Coinetic updates itself, so no recurring update job is needed. A repair / update run can be forced.
  3. Reads the license key from the RMM placeholder @CoineticKey@ (or the environment variable COINETIC_KEY) - never from the script text. The log shows only the key's last 5 characters.
  4. Downloads the installer from https://coinetic.io/download/CoineticSetup.exe into a new, empty temp folder.
  5. Runs it only if it is validly signed by Salus Alpha Group AG. Anything else is deleted and nothing is run (exit code 13).
  6. Installs with CoineticSetup.exe /quiet /key=CNT-... /accepteula. The installer checks the key online before it installs anything.
  7. Hands the exit code back to your RMM and writes a log to %SystemRoot%\Temp\coinetic-rmm-deploy.log.

1. Before you start

2. The placeholders

The script starts with four values that your RMM fills in before it runs the script. A placeholder that was not filled in counts as empty.

PlaceholderValueNeeded
@CoineticKey@The customer's license key CNT-XXXXX-XXXXX-XXXXX-XXXXXYes, unless you use the trial
@CoineticTrial@true = start the free 30-day trial when no key is givenNo
@CoineticDefaultView@simple or full - the view all users of the computer see firstNo
@CoineticRepair@true = run the installer even if Coinetic AI Security is installed (update / repair)No

Outside an RMM, set the environment variables COINETIC_KEY (and COINETIC_TRIAL) instead.

3. ConnectWise RMM

  1. Go to Automation › Tasks and choose Add › Script Editor. Name the task, for example Install Coinetic AI Security.
  2. With Add Parameter, create a parameter CoineticKey of type Text String (tick Required Field unless you use the trial). Optional: CoineticTrial, CoineticDefaultView and CoineticRepair, also Text String. Use these names without spaces, so they match the placeholders @CoineticKey@ and so on.
  3. With Add Row, add a PowerShell Script row, set Run as to System, and paste the full script from section 5.
  4. Save, run the task on one device with that customer's key, and read the task output: the script's log lines and its exit code.
  5. Then run it on the customer's other Windows devices - one run per customer key. To catch new devices automatically, you can attach the task as the automation of a monitor that targets that customer's devices.

4. ConnectWise Automate

  1. Create a new script for computers, for example Install Coinetic AI Security.
  2. Before the PowerShell step, give the script a variable named CoineticKey with the customer's license key - for example read from a client-level Extra Data Field, so each client keeps its own key and nobody types it into the script. Optional: variables CoineticDefaultView, CoineticTrial and CoineticRepair.
  3. Add the Execute Script function with Script Type PowerShell, paste the full script from section 5 into its editor, and leave Script Parameters empty. Automate fills @CoineticKey@ and the other placeholders in the script text from your script variables.
  4. Let it run with administrator rights on the computer, and keep the output (for example in a variable written to the script log), so you see the exit code and log lines.
  5. Run it on one computer, check the script log, then schedule it for the client's Windows computers.

Check the first run: the output must contain Licence key from the RMM variable CoineticKey (ends with XXXXX). If it says No licence key found (exit code 10), the variable did not reach the script - check its name.

5. The script

Copy it as it is - the placeholders are filled by your RMM, nothing to replace by hand. Free to use and adapt for deploying Coinetic AI Security.

<#
.SYNOPSIS
    Deploy Coinetic AI Security silently from ConnectWise Automate or ConnectWise RMM (runs as SYSTEM).
    Coinetic AI Security - https://coinetic.io

.DESCRIPTION
    Downloads the official installer from https://coinetic.io/download/CoineticSetup.exe,
    checks that it is validly Authenticode-signed by Salus Alpha Group AG, and runs
        CoineticSetup.exe /quiet /key=<licence key> /accepteula
    The installer checks the licence key online before it installs anything.

    Idempotent: a computer that already has Coinetic AI Security is skipped (exit 0) -
    the installed Coinetic updates itself, no RMM job is needed after the first installation.
    Set CoineticRepair to true to run the installer anyway (update / repair).

    Licence key - never hard-coded in this script. The RMM fills in the placeholders below:
      ConnectWise Automate  @CoineticKey@ is an Automate script variable, e.g. filled from a
                            client-level Extra Data Field "Coinetic License Key" with the
                            "Extra Data Field Get Value" function before "Execute Script".
      ConnectWise RMM       add a script parameter named CoineticKey (Text String) in the
                            Script Editor; the PowerShell row receives it as @CoineticKey@.
      Anything else         set the environment variable COINETIC_KEY.
    A placeholder that was not filled in counts as empty. Without a key, set CoineticTrial to
    true to start the free 30-day trial instead (all features, no payment details).

    Optional placeholders
      @CoineticTrial@         true          - free 30-day trial when no key is given
      @CoineticDefaultView@   simple | full - which view all users of the computer see first
      @CoineticRepair@        true          - run the installer even if Coinetic is installed

    Requirements: Windows 7 SP1 / Server 2008 R2 SP1 up to Windows 11 / Server 2025, 32- or 64-bit,
    any Windows language. Windows PowerShell 2.0 or later (5.1 recommended); works in the 32-bit
    PowerShell some RMM agents start on 64-bit Windows. Run as SYSTEM or administrator. The computer
    needs relayer.coinetic.io on TCP 443 (licence check, direct connection, not through a web proxy)
    and coinetic.io (download, later updates).

    Exit codes
      0    Coinetic AI Security is installed (or was already installed) and the protection is running
      1    Setup failed - see C:\ProgramData\Coinetic\setup.log on the computer
      3    Licence key not valid, or no valid licence - nothing installed
      5    First installation without /accepteula - nothing installed (should not happen with this script)
      740  Not run as administrator or SYSTEM - nothing changed
      10   No licence key found and trial not selected, or the key has an unexpected format
      11   Windows version not supported (Windows 7 SP1 / Server 2008 R2 SP1 or later needed)
      12   Download failed
      13   Signature check failed - the downloaded file was deleted, nothing was run
      14   Another Coinetic setup is already running - try again later
      15   The installer could not be started

    Log: Write-Output (shown in the Automate script log / ConnectWise RMM task output) and
    %SystemRoot%\Temp\coinetic-rmm-deploy.log. The licence key is never logged - only its last 5 characters.

.NOTES
    Coinetic AI Security - https://coinetic.io   |   questions: office@coinetic.io
    Deployment guide: https://coinetic.io/deploy-connectwise  (all options: https://coinetic.io/deploy-coinetic)
    Free to use and adapt for deploying Coinetic AI Security. Provided AS IS, without warranty of any
    kind; to the maximum extent permitted by law, no liability (see https://coinetic.io/eula, sections 7 and 8).
    Test on one computer before you roll it out.
#>

# ---------------------------------------------------------------------------------------------
# Values from the RMM (placeholders are replaced by Automate / ConnectWise RMM before the run)
# ---------------------------------------------------------------------------------------------
$InKey         = '@CoineticKey@'
$InTrial       = '@CoineticTrial@'
$InDefaultView = '@CoineticDefaultView@'
$InRepair      = '@CoineticRepair@'

# ---------------------------------------------------------------------------------------------
# Settings (the defaults are fine for most MSPs)
# ---------------------------------------------------------------------------------------------
$DownloadUrl  = 'https://coinetic.io/download/CoineticSetup.exe'
$SignerOrg    = 'Salus Alpha Group AG'
$LogFile      = Join-Path $env:SystemRoot 'Temp\coinetic-rmm-deploy.log'

# ---------------------------------------------------------------------------------------------
# Helpers (PowerShell 2.0 compatible; no parsing of localized command output)
# ---------------------------------------------------------------------------------------------
$Inv = [System.Globalization.CultureInfo]::InvariantCulture

function Write-Log([string]$Message) {
    $line = (Get-Date).ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss', $Inv) + 'Z  ' + $Message
    Write-Output $line
    try { Add-Content -Path $LogFile -Value $line -Encoding UTF8 -ErrorAction Stop } catch { }
}

function Test-True([string]$Value) {
    if ($Value -eq $null) { return $false }
    $v = $Value.Trim().ToLowerInvariant()
    return ($v -eq 'true' -or $v -eq '1' -or $v -eq 'yes')
}

function Get-Text([object]$Value) {
    if ($Value -eq $null) { return '' }
    return ([string]$Value).Trim()
}

function Get-ProgramFiles64 {
    # 32-bit PowerShell on 64-bit Windows: ProgramW6432 points to the real "Program Files"
    if ($env:ProgramW6432) { return $env:ProgramW6432 }
    return $env:ProgramFiles
}

function Test-CoineticInstalled {
    $exe = Join-Path (Get-ProgramFiles64) 'Coinetic\Coinetic.exe'
    if (-not (Test-Path -LiteralPath $exe)) { return $false }
    # In a 64-bit (or 32-bit-on-32-bit) process the uninstall key is visible too; it is gone
    # right after an uninstall, while Coinetic.exe deletes itself a few seconds later.
    $wow = ([IntPtr]::Size -eq 4) -and ($env:PROCESSOR_ARCHITEW6432)
    if (-not $wow) {
        return (Test-Path -LiteralPath 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Coinetic')
    }
    return $true
}

function Get-Placeholder([string]$Value) {
    # An RMM placeholder that was not replaced (still @Name@) counts as empty
    $v = Get-Text $Value
    if ($v -match '^@[A-Za-z0-9_]+@$') { return '' }
    return $v
}

function Set-DefaultView([string]$View) {
    # Same as https://coinetic.io/deploy-coinetic section 7: keeps every other line of engine.ini
    $ini  = Join-Path $env:ProgramData 'Coinetic\engine.ini'
    $utf8 = New-Object System.Text.UTF8Encoding($false)
    $lines = @()
    if (Test-Path -LiteralPath $ini) {
        $lines = @([System.IO.File]::ReadAllLines($ini, $utf8) | Where-Object { $_ -notmatch '^\s*DefaultView\s*=' })
    }
    $lines += "DefaultView=$View"
    [System.IO.File]::WriteAllLines($ini, [string[]]$lines, $utf8)
}

# ---------------------------------------------------------------------------------------------
# 1. Checks before anything is downloaded
# ---------------------------------------------------------------------------------------------
Write-Log 'Coinetic AI Security - RMM deployment (ConnectWise) started.'

$principal = New-Object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())
if (-not $principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) {
    Write-Log 'Not run as administrator or SYSTEM - nothing changed. Run the script as SYSTEM (Automate: default credentials; ConnectWise RMM: Run as System).'
    exit 740
}

$os = [System.Environment]::OSVersion.Version
if ($os -lt (New-Object System.Version 6, 1, 7601)) {
    Write-Log "Windows version $os is not supported - Windows 7 SP1 / Server 2008 R2 SP1 or later is needed."
    exit 11
}

$repair = Test-True (Get-Placeholder $InRepair)
$view   = (Get-Placeholder $InDefaultView).ToLowerInvariant()
if ($view -ne '' -and $view -ne 'simple' -and $view -ne 'full') {
    Write-Log "CoineticDefaultView '$view' ignored - use simple or full."
    $view = ''
}

if ((Test-CoineticInstalled) -and -not $repair) {
    Write-Log 'Coinetic AI Security is already installed - nothing to do (it updates itself).'
    if ($view -ne '') {
        try { Set-DefaultView $view; Write-Log "Start view set to $view." } catch { Write-Log "Could not set the start view: $($_.Exception.Message)" }
    }
    exit 0
}

if (Get-Process -Name 'CoineticSetup' -ErrorAction SilentlyContinue) {
    Write-Log 'Another Coinetic setup is running on this computer - try again later.'
    exit 14
}

# Licence key: RMM placeholder first, then the environment variable COINETIC_KEY
$key = Get-Placeholder $InKey
$source = 'RMM variable CoineticKey'
if ($key -eq '') {
    $key = Get-Text $env:COINETIC_KEY
    $source = 'environment variable COINETIC_KEY'
}
$trial = Test-True (Get-Placeholder $InTrial)
if (-not $trial) { $trial = Test-True $env:COINETIC_TRIAL }

$setupArgs = @('/quiet', '/accepteula')
if ($key -ne '') {
    # Only plain key characters - nothing that could add a switch or break the command line
    if ($key.Length -gt 64 -or $key -notmatch '^CNT-[A-Za-z0-9-]+$') {
        Write-Log "The licence key from the $source does not look like CNT-XXXXX-XXXXX-XXXXX-XXXXX - nothing installed."
        exit 10
    }
    $setupArgs += "/key=$key"
    $tail = $key.Substring([Math]::Max(0, $key.Length - 5))
    Write-Log "Licence key from the $source (ends with $tail)."
} elseif ($trial) {
    $setupArgs += '/trial'
    Write-Log 'No licence key - starting the free 30-day trial (CoineticTrial is set).'
} elseif ($repair -and (Test-CoineticInstalled)) {
    Write-Log 'Repair / update without a key (works only where a valid licence is already on this computer).'
} else {
    Write-Log 'No licence key found. Fill in CoineticKey (Automate variable / ConnectWise RMM parameter) or COINETIC_KEY, or set CoineticTrial to true.'
    exit 10
}

# ---------------------------------------------------------------------------------------------
# 2. Download into a new, empty folder
# ---------------------------------------------------------------------------------------------
$work = Join-Path $env:TEMP ('CoineticDeploy-' + [Guid]::NewGuid().ToString('N'))
$file = Join-Path $work 'CoineticSetup.exe'
try { New-Item -ItemType Directory -Path $work -Force -ErrorAction Stop | Out-Null } catch {
    Write-Log "Could not create the temp folder $work : $($_.Exception.Message)"
    exit 12
}

# TLS 1.2 for older Windows (ignored where it is already the default)
try { [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 3072 } catch { }

Write-Log "Downloading $DownloadUrl"
try {
    (New-Object System.Net.WebClient).DownloadFile($DownloadUrl, $file)
} catch {
    Write-Log "Download failed: $($_.Exception.Message)"
    Remove-Item -LiteralPath $work -Recurse -Force -ErrorAction SilentlyContinue
    exit 12
}

# ---------------------------------------------------------------------------------------------
# 3. Run only a file that is validly signed by Salus Alpha Group AG
# ---------------------------------------------------------------------------------------------
$sig = Get-AuthenticodeSignature -FilePath $file
$subject = ''
if ($sig.SignerCertificate) { $subject = $sig.SignerCertificate.Subject }
if ($sig.Status -ne 'Valid' -or $subject -notmatch ('(^|,\s*)O="?' + [regex]::Escape($SignerOrg) + '"?(,|$)')) {
    Write-Log "Signature check failed: status $($sig.Status), signer '$subject'. The file was deleted, nothing was run."
    Remove-Item -LiteralPath $work -Recurse -Force -ErrorAction SilentlyContinue
    exit 13
}
Write-Log "Signature valid: $subject"

# ---------------------------------------------------------------------------------------------
# 4. Install
# ---------------------------------------------------------------------------------------------
Write-Log ('Running CoineticSetup.exe ' + ((@($setupArgs) | ForEach-Object { if ($_ -like '/key=*') { '/key=...' + $_.Substring([Math]::Max(5, $_.Length - 5)) } else { $_ } }) -join ' '))
try {
    $p = Start-Process -FilePath $file -ArgumentList $setupArgs -Wait -PassThru -ErrorAction Stop
    $code = $p.ExitCode
    if ($code -eq $null) { $code = 1 }   # never report success when Windows did not hand back an exit code
} catch {
    Write-Log "The installer could not be started: $($_.Exception.Message)"
    Remove-Item -LiteralPath $work -Recurse -Force -ErrorAction SilentlyContinue
    exit 15
}
Remove-Item -LiteralPath $work -Recurse -Force -ErrorAction SilentlyContinue

switch ($code) {
    0       { Write-Log 'Coinetic AI Security installed - the protection is running.' }
    3       { Write-Log 'Licence key not valid, or no valid licence - nothing installed. Check the key in the partner area and that relayer.coinetic.io is reachable on TCP 443.' }
    5       { Write-Log 'First installation needs /accepteula - nothing installed.' }
    740     { Write-Log 'Not run as administrator or SYSTEM - nothing changed.' }
    default { Write-Log "Setup failed (exit code $code) - see C:\ProgramData\Coinetic\setup.log" }
}

if ($code -eq 0 -and $view -ne '') {
    try { Set-DefaultView $view; Write-Log "Start view set to $view." } catch { Write-Log "Could not set the start view: $($_.Exception.Message)" }
}

exit $code

6. Exit codes

CodeMeaningWhat to do
0Done - Coinetic AI Security is installed (or was already installed) and the protection is running.Nothing.
1Setup failed.Read C:\ProgramData\Coinetic\setup.log on that computer.
3The license key is not valid, or there is no valid license on this computer. Nothing installed.Check the key, its computer count and validity in your partner area, and that the computer reaches relayer.coinetic.io on TCP 443.
5First installation without /accepteula. Nothing installed.Should not happen - the script always passes it. Write to us.
740Not run as administrator or SYSTEM. Nothing changed.Run the script as SYSTEM.
10No license key found and no trial selected, or the key does not look like CNT-....Fill in CoineticKey (Automate variable or ConnectWise RMM parameter), or set CoineticTrial to true.
11Windows older than Windows 7 SP1 / Server 2008 R2 SP1.Not supported.
12The download failed.Check internet access and any proxy to coinetic.io.
13The signature check failed. The file was deleted, nothing was run.Check for TLS inspection or a proxy that changes downloads; write to us.
14Another Coinetic setup is already running on this computer.Run the script again later.
15The installer could not be started.See the log line; check the logs of your endpoint protection.

Codes 0, 1, 3, 5 and 740 come from the installer (see the deployment guide); 10 to 15 come from the script.

The script writes every step to its output (the Automate script log or the ConnectWise RMM task output) and to %SystemRoot%\Temp\coinetic-rmm-deploy.log on the computer.

7. How to verify

To check many computers at once, this line returns True where Coinetic AI Security is installed (PowerShell, as SYSTEM or administrator):

Test-Path -LiteralPath (Join-Path $(if ($env:ProgramW6432) { $env:ProgramW6432 } else { $env:ProgramFiles }) 'Coinetic\Coinetic.exe')

8. After the rollout

Not a partner yet?

Resellers get 25 % off every license they buy for their customers - volume prices from 250 computers on request - on every renewal. Approved resellers get a free NFR license (not for resale) for their own computers - to run Coinetic AI Security in their office and show it to customers. Coinetic for IT service providers and MSPs →

Or try it first: 30 days free, all features, no payment details →

Frequently asked

Does the same script work in ConnectWise Automate and ConnectWise RMM?

Yes. Both fill in placeholders written as @Name@ in the script text: Automate from script variables, ConnectWise RMM from task parameters. A placeholder that was not filled in counts as empty.

Where does the license key come from?

From @CoineticKey@, filled in by your RMM, or else from the environment variable COINETIC_KEY. The key is never written into the script, and the log shows only its last 5 characters.

Why does the script end with exit code 10?

It found no license key and the trial was not selected, or the key does not look like CNT-XXXXX-XXXXX-XXXXX-XXXXX. Check that the Automate variable or the ConnectWise RMM parameter is named CoineticKey and has a value.

Does it work when the agent starts the 32-bit PowerShell?

Yes. The script finds the real Program Files folder on 64-bit Windows, so it detects an existing installation correctly from 32-bit PowerShell too.

Do I have to push updates with my RMM?

No. The installed Coinetic AI Security updates itself and installs only updates signed by Salus Alpha Group AG. Your RMM is needed only for the first installation.

Can I leave the script on a schedule?

Yes. Computers that already have Coinetic AI Security are skipped with exit code 0, so a recurring run only installs it on new computers.

Why does the script end with exit code 13?

The downloaded file was not validly signed by Salus Alpha Group AG, so the script deleted it and ran nothing. This usually means a proxy or TLS inspection changed the download. Write to office@coinetic.io if it keeps happening.

How do I uninstall Coinetic AI Security silently?

Run "C:\Program Files\Coinetic\Coinetic.exe" /uninstall /quiet /code=<uninstall code> as SYSTEM (or /pw=<password> if you set an uninstall password). The uninstall code is made for that one computer and valid for 7 days - ask for it at office@coinetic.io. Without it nothing is removed (exit code 6) and the attempt is reported. Details in the deployment guide.

Can I change the script?

Yes, it is free to use and adapt for deploying Coinetic AI Security. Keep the signature check: it makes sure only our installer runs on your customers' computers.

ConnectWise, ConnectWise Automate and ConnectWise RMM are trademarks of their owner; they are named here only to say which tools this guide is for. Menu names can change - check them against ConnectWise's own documentation.

This guide is general information, provided "as is" without warranty, and we accept no liability for its use to the maximum extent permitted by law; see sections 7 and 8 of the license agreement. Test every change on one computer first.

Coinetic AI Security - https://coinetic.io