Posted February 2, 20178 yr Hi, Does anyone know how we can remove Malwarebytes and Spybot on all the devices under a group? Any ideas Pulseway or 3rd Party? Thanks Phil
February 3, 20178 yr Administrators Hi Phil, Have you tried sending the uninstall command from the Pulseway app in the Computer Details -> Installed Applications. -Paul
February 3, 20178 yr Author There is no option to uninstall theses programs in the uninstall section in Pulseway So we have 100 PCs (not on a domain), which we have to uninstall the programs and then install Pulseway. Any ideas would be good Or silent / batch file install of pulseway would be good...
February 3, 20178 yr Administrators Try this script to uninstall Malwarebytes: Credits go to cvucic from Malwarebytes Forms (post). I've modified it to use the Malwarebytes uninstaller rather than WMI which didn't work when I tested. Function List-Programs { [cmdletbinding()] [cmdletbinding()] param( [parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [string[]]$ComputerName = $env:computername ) begin { $UninstallRegKey="SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" } process { foreach($Computer in $ComputerName) { Write-Verbose "Working on $Computer" if(Test-Connection -ComputerName $Computer -Count 1 -ea 0) { $HKLM = [microsoft.win32.registrykey]::OpenRemoteBaseKey('LocalMachine',$computer) $UninstallRef = $HKLM.OpenSubKey($UninstallRegKey) $Applications = $UninstallRef.GetSubKeyNames() foreach ($App in $Applications) { $AppRegistryKey = $UninstallRegKey + "\\" + $App $AppDetails = $HKLM.OpenSubKey($AppRegistryKey) $AppGUID = $App $AppDisplayName = $($AppDetails.GetValue("DisplayName")) $AppVersion = $($AppDetails.GetValue("DisplayVersion")) $AppPublisher = $($AppDetails.GetValue("Publisher")) $AppInstalledDate = $($AppDetails.GetValue("InstallDate")) $AppUninstall = $($AppDetails.GetValue("UninstallString")) if(!$AppDisplayName) { continue } $OutputObj = New-Object -TypeName PSobject $OutputObj | Add-Member -MemberType NoteProperty -Name ComputerName -Value $Computer.ToUpper() $OutputObj | Add-Member -MemberType NoteProperty -Name AppName -Value $AppDisplayName $OutputObj | Add-Member -MemberType NoteProperty -Name AppVersion -Value $AppVersion $OutputObj | Add-Member -MemberType NoteProperty -Name AppVendor -Value $AppPublisher $OutputObj | Add-Member -MemberType NoteProperty -Name InstalledDate -Value $AppInstalledDate $OutputObj | Add-Member -MemberType NoteProperty -Name UninstallKey -Value $AppUninstall $OutputObj | Add-Member -MemberType NoteProperty -Name AppGUID -Value $AppGUID $OutputObj# | Select ComputerName, DriveName } } } } end {} } Function Uninstall-Program { [cmdletbinding()] param ( [parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)] [string]$ComputerName = $env:computername, [parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Mandatory=$true)] [string]$UninstallKey ) try { $returnval = ([WMICLASS]"\\$computerName\ROOT\CIMV2:win32_process").Create($UninstallKey + " /VERYSILENT /SUPPRESSMSGBOXES /NORESTART") } catch { write-error "Failed to trigger the uninstallation. Review the error message" $_ exit } switch ($($returnval.returnvalue)){ 0 { "Uninstallation command triggered successfully" } 2 { "You don't have sufficient permissions to trigger the command on $Computer" } 3 { "You don't have sufficient permissions to trigger the command on $Computer" } 8 { "An unknown error has occurred" } 9 { "Path Not Found" } 9 { "Invalid Parameter"} } } function Uninstall-MBAM { param($computername) try { $UninstallKey = (List-Programs -ComputerName $computername | where {$_.AppName -like "*Malwarebytes*"}).UninstallKey Uninstall-Program -computername $computername -UninstallKey $UninstallKey } Catch { $ErrorMessage = $_.Exception.Message $FailedItem = $_.Exception.ItemName Write-Host "There was an error on $computername.`r`n$FailedItem`r`nMessage: $ErrorMessage" Break } } Uninstall-MBAM -computername $env:computername -Paul
February 3, 20178 yr Author Just tested it on 2 PCs and it works perfect, Thanks Paul!!!!!!!! Wishlist Removal Scripts - SuperAntispyware - Spybot  -ESET We could then make 1 script to remove them all. This would then enable us to push out Kaspersky without issues...
Create an account or sign in to comment