Script library - screenconnect collector

This commit is contained in:
silversword411 2021-05-20 21:49:01 -04:00
parent fad739bc01
commit 1d6c55ffa6
No known key found for this signature in database
GPG Key ID: 6F4BD176F56B50CA
2 changed files with 37 additions and 0 deletions

View File

@ -161,6 +161,18 @@
"shell": "powershell",
"category": "TRMM (Win):Collectors"
},
{
"guid": "973c34d7-cab0-4fda-999c-b4933655f946",
"filename": "Win_Screenconnect_GetGUID.ps1",
"submittedBy": "https://github.com/silversword411",
"name": "Screenconnect - Get GUID for client",
"description": "Returns Screenconnect GUID for client - Use with Custom Fields for later use. ",
"args": [
"-serviceName {{client.ScreenConnectService}}"
],
"shell": "powershell",
"category": "TRMM (Win):Collectors"
},
{
"guid": "95a2ee6f-b89b-4551-856e-3081b041caa7",
"filename": "Win_Power_Profile_Reset_High_Performance_to_Defaults.ps1",

View File

@ -0,0 +1,25 @@
<#
Requires global variables for serviceName "ScreenConnectService"
serviceName is the name of the ScreenConnect Service once it is installed EG: "ScreenConnect Client (1327465grctq84yrtocq)"
Variable value must start and end with " (Prior to TRMM Version 0.6.5), remove / don't use " on TRMM Version 0.6.5 or later.
Requires Custom Fields Agent entry Name: ScreenConnectGUID Type: text
URL Action entry: https://YOURNAME.screenconnect.com/Host#Access/All%20Machines//{{agent.ScreenConnectGUID}}/Join
#>
param (
[string] $serviceName
)
if (!$serviceName) {
write-output "Variable not specified ScreenConnectService, please create a global custom field under Client called ScreenConnectService, Example Value: `"ScreenConnect Client (1327465grctq84yrtocq)`" `n"
$ErrorCount += 1
}
if (!$ErrorCount -eq 0) {
exit 1
}
$imagePath = Get-Itempropertyvalue "HKLM:\SYSTEM\ControlSet001\Services\$serviceName" -Name "ImagePath"
$imagePath2 = ($imagePath -split "&s=")[1]
$machineGUID = ($imagePath2 -split "&k=")[0]
Write-Output $machineGUID