Update Win_ScreenConnectAIO.ps1

added support for `-company {{client.name}} -site {{site.name}}` command line arguments. 

This results in ScreenConnect adding those fields to the agent so it's easier to filter down.
This commit is contained in:
David Rudduck 2021-05-03 11:29:48 +10:00 committed by GitHub
parent d7e11af7f8
commit a8538a7e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,7 @@
<# <#
Requires global variables for serviceName "ScreenConnectService" and url "ScreenConnectInstaller"' Requires global variables for serviceName "ScreenConnectService" and url "ScreenConnectInstaller"
serviceName is the name of the ScreenConnect Service once it is installed EG: "ScreenConnect Client (1327465grctq84yrtocq)" serviceName is the name of the ScreenConnect Service once it is installed EG: "ScreenConnect Client (1327465grctq84yrtocq)"
url is the path the download the exe version of the ScreenConnect Access installer' url is the path the download the exe version of the ScreenConnect Access installer
Both variables values must start and end with " (Prior to TRMM Version 0.6.5), remove / don't use " on TRMM Version 0.6.5 or later. Both variables values must start and end with " (Prior to TRMM Version 0.6.5), remove / don't use " on TRMM Version 0.6.5 or later.
Also accepts uninstall variable to remove the installed instance if required. Also accepts uninstall variable to remove the installed instance if required.
#> #>
@ -9,7 +9,9 @@ Also accepts uninstall variable to remove the installed instance if required.
param ( param (
[string] $serviceName, [string] $serviceName,
[string] $url, [string] $url,
[string] $action [string] $action,
[string] $company,
[string] $site
) )
$ErrorCount = 0 $ErrorCount = 0
@ -82,7 +84,7 @@ if ($action -eq "uninstall") {
{ {
$start_time = Get-Date $start_time = Get-Date
$wc = New-Object System.Net.WebClient $wc = New-Object System.Net.WebClient
$wc.DownloadFile("$url", "$OutPath\$output") $wc.DownloadFile("$url&c=$company&c=$site", "$OutPath\$output")
Start-Process -FilePath $OutPath\$output -Wait Start-Process -FilePath $OutPath\$output -Wait
Write-Output "Time taken to download and install: $((Get-Date).Subtract($start_time).Seconds) second(s)" Write-Output "Time taken to download and install: $((Get-Date).Subtract($start_time).Seconds) second(s)"
exit 0 exit 0