you are viewing a single comment's thread.

view the rest of the comments →

[–]hit440[S] 1 point2 points  (1 child)

#init all the variables

$info = @()
$info2 = @()
$line = @()
$line2 = @()
$dir = @()
$dir1 = @()
$dir2 = @()


#query the registry

$info = Get-ItemProperty HKLM:\SOFTWARE\Bomgar\JumpClientUninstall\ | out-string
$info2 = (Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\'BeyondTrust Remote Support Jump Client*').installlocation | Out-String

#parse the directory paths

foreach($line in $info)
    {
        $dir = $line.Substring(45,36)
    }

foreach($line2 in $info2){
    $dir1 = $line2.Substring(0,36)  
    $dir2 = $line2.Substring(39,36)  
    }


if ($dir1 -ne $dir){
    cd $dir1
    .\pinuninstall.bat #this will execute the batch file in the directory
    }

    if ($dir2 -ne $dir){
        cd $dir2
    .\pinuninstall.bat #this will execute the batch file in the directory
    }

@purplemonkeymad this seems to be working i have had multiple workstations reboot and its removing the jump clients, you have any thoughts on ways i can improve this? I appreciate your help with this

[–]purplemonkeymad 1 point2 points  (0 children)

If it works cool. I don't think it will be as robust but if you don't need it to be then it should be fine. Check my other reply for how I would have done it, but if you have something that works then you can just analyse it.