diff --git a/scripts/Win_ScreenConnectAIO.ps1 b/scripts/Win_ScreenConnectAIO.ps1 index a727df8e..a42bbede 100644 --- a/scripts/Win_ScreenConnectAIO.ps1 +++ b/scripts/Win_ScreenConnectAIO.ps1 @@ -9,7 +9,9 @@ Also accepts uninstall variable to remove the installed instance if required. param ( [string] $serviceName, [string] $url, - [string] $action + [string] $action, + [string] $company, + [string] $site ) $ErrorCount = 0 @@ -82,7 +84,7 @@ if ($action -eq "uninstall") { { $start_time = Get-Date $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 Write-Output "Time taken to download and install: $((Get-Date).Subtract($start_time).Seconds) second(s)" exit 0 diff --git a/scripts_wip/Alert_MSTeams.ps1 b/scripts_wip/Alert_MSTeams.ps1 new file mode 100644 index 00000000..503b447d --- /dev/null +++ b/scripts_wip/Alert_MSTeams.ps1 @@ -0,0 +1,61 @@ +<# +Microsoft Teams notifications +Submitted by Insane Technologies / David Rudduck +requires +- agent {{agent.hostname}} +- client {{client.name}} +- site {{site.name}} +- user {{agent.logged_in_user}} +- reboot {{agent.needs_reboot}} +- patches {{agent.patches_last_installed}} +- alert_time {{alert.alert_time}} +- message {{alert.message}} +- severity {{alert.severity}} +#> +param ( + [string] $agent, + [string] $client, + [string] $site, + [string] $user, + [string] $reboot, + [string] $patches, + [string] $time, + [string] $message, + [string] $severity +) + +$webhookurl = 'ADDYOURMSTEAMSWEBHOOKURLHERE' + +if($severity -eq "error"){ + $colour = 'ff0000' +} +if($severity -eq "warning"){ + $color = 'ffa500' +} +if($severity -eq "info"){ + $colour = 'ffff00' +} + +$msteams_payload = '{"@context": "https://schema.org/extensions", "@type": "MessageCard", "summary": "TacticalRMM Alert", "themeColor": "' + $colour +'", ' +$msteams_payload = $msteams_payload + '"text": "' + +if($time) { + $msteams_payload = $msteams_payload + 'Alert Time: ' + $time +'
' +} + +$msteams_payload = $msteams_payload + 'Client: ' + $client +'
' +$msteams_payload = $msteams_payload + 'Site: ' + $site +'
' +$msteams_payload = $msteams_payload + 'Device: ' + $agent +'
' +if($user) { + $msteams_payload = $msteams_payload + 'User: ' + $user +'
' +} +if($reboot) { + $msteams_payload = $msteams_payload + 'Device has pending reboot
' +} +if($patches) { + $msteams_payload = $msteams_payload + 'Patches were last applied: ' + $patches +'
' +} +$msteams_payload = $msteams_payload + $message + '"}' + +# Write-Output $msteams_payload +Invoke-RestMethod -Method post -ContentType 'Application/Json' -Body $msteams_payload -Uri $webhookurl