Fixed ScreenConnect Collector script for ps 2.0

This commit is contained in:
Samuel Meuchel 2021-07-06 19:41:16 -05:00
parent 98a11a3645
commit 92c386ac0e
2 changed files with 4 additions and 3 deletions

View File

@ -175,7 +175,7 @@
"name": "Screenconnect - Get GUID for client",
"description": "Returns Screenconnect GUID for client - Use with Custom Fields for later use. ",
"args": [
"-serviceName {{client.ScreenConnectService}}"
"{{client.ScreenConnectService}}"
],
"shell": "powershell",
"category": "TRMM (Win):Collectors"

View File

@ -19,8 +19,9 @@ if (!$serviceName) {
if (!$ErrorCount -eq 0) {
exit 1
}
$imagePath = Get-Itempropertyvalue "HKLM:\SYSTEM\ControlSet001\Services\$serviceName" -Name "ImagePath"
$imagePath = (Get-Item -Path HKLM:\SYSTEM\ControlSet001\Services\$serviceName).GetValue('ImagePath')
$imagePath2 = ($imagePath -split "&s=")[1]
$machineGUID = ($imagePath2 -split "&k=")[0]
Write-Output $machineGUID