Installing CrowdStrike Falcon Silently with ScreenConnect

We found this code when we migrated our ScreenConnect instance to the cloud. This was the "migration" script which we modified for use with CrowdStrike. Simply put the Falcon sensor on a public webserver, and issue the following command (copy/paste) in SC.

Update the last line with parameters for your organization.

#!ps
#timeout=3000000
#maxlength=1000000
function downloadFile($url)
{
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$uri = New-Object "System.Uri" "$url"
$targetFile = "${env:TEMP}\CrowdStrike.exe"
$request = [System.Net.HttpWebRequest]::Create($uri)
$request.set_Timeout(1200000)
$response = $request.GetResponse()
$responseStream = $response.GetResponseStream()
$targetStream = New-Object -TypeName System.IO.FileStream -ArgumentList $targetFile, Create
$buffer = new-object byte[] 10KB
$count = $responseStream.Read($buffer,0,$buffer.length)
$downloadedBytes = $count
while ($count -gt 0)
{
$targetStream.Write($buffer, 0, $count)
$count = $responseStream.Read($buffer,0,$buffer.length)
$downloadedBytes = $downloadedBytes + $count
}
$targetStream.Flush()
$targetStream.Close()
$targetStream.Dispose()
$responseStream.Dispose()
}
downloadFile "https://myhost.host.com/FalconInstaller-Filename.exe"; Start-Process -FilePath "${env:TEMP}\CrowdStrike.exe" -ArgumentList "/install /quiet /norestart CID=[INSERTCIDHERE]"