Fixed ScreenConnect Collector script for ps 2.0
This commit is contained in:
parent
98a11a3645
commit
92c386ac0e
|
@ -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"
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue