如何使用PowerShell卸载戴尔支持助手?

4

有一篇关于支持助手易受攻击的文章被发布了。

高层管理已决定支持助手不安全,并下令将其从每台机器上移除......

不,我不能/也不会试图说服他们改变主意,无论如何这都将会发生。

在过去的8个小时里,我尝试了一个又一个不成功的脚本,以期完成此事。然而这该死的程序就是不肯结束。

以下是我目前为止的进展。

MsiExec.exe /X "{0309AC01-330F-494C-B27D-58E297E4674F}" /quiet
MsiExec.exe /X "{F1D17890-F41B-4BFA-8893-B2C8A248BE0D}" /quiet

$CurrentSAPkg = Get-WMIObject -Class Win32_Product  | Where-Object { $_.Name -like "Dell*" }
$CurrentSAPkg.Uninstall()

& "C:\Program Files\Dell\SupportAssist\uninstaller.exe" /arp /S

get-WMIObject 已经可以使用,并且 uninstaller.exe /arp /S 也可以使用。

然而,这些只适用于旧版本,新版本需要类似前两个命令的其他操作,但存在一个问题。

/quiet 标志使其无法工作。如果我省略 quiet 标志,会弹出一个窗口,“您确定吗”,点击“是”,它就会卸载,但是在使用 quiet 标志时,没有任何反应,该程序仍然存在。

我使用以下代码获取卸载路径:

$regQuery32 = Get-ChildItem -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" | Where {$_.GetValue("DisplayName") -match "Dell*"}

我现在非常讨厌Support Assist,我希望它消失,我已经快要崩溃了。


msiexec /? 是你的好帮手。 - montonero
5个回答

2
遇到了类似的问题。我有一堆不同版本的Support Assist电脑。我从几个不同的来源编译了这个。到目前为止,我的成功率非常高。我正在使用PDQ部署。虽然我不是最擅长PowerShell,但也许这会有所帮助。
"C:\ProgramData\Package Cache\{ec40a028-983b-4213-af2c-77ed6f6fe1d5}\DellUpdateSupportAssistPlugin.exe" /uninstall /quiet
MsiExec.exe /qn /norestart /X{E98E94E2-12D1-48E5-AC69-2C312F466136}
MsiExec.exe /qn /norestart /X{806422F1-FC4E-4D7C-8855-05748AEFC031}
MsiExec.exe /X{0309AC01-330F-494C-B27D-58E297E4674F} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{122666A9-2995-4E47-A75E-6423A827B7AF} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{18EF001B-B005-46CB-917B-112BA69ED85E} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{1AE53ECE-2255-4191-998B-07741E5EFCDA} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{33E712C1-2183-421C-9BC8-C902DB9C596C} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{45FD01F4-B11B-4A58-B465-1D600B5CDF64} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{4CB4741A-20C1-454E-8276-993D06A76D67} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{50EF2C72-95EC-4206-AAC3-9E84004A6140} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{5A18ABE3-52D1-4CA5-9169-25EC7E789582} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{8D7B279C-A661-465C-9658-F62FBD6A6B91} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{9074E264-F615-4DDE-969E-1FDBCFEC3FB5} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{90881C8E-6C4F-4662-9923-85AFCA058C44} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{9DD6B149-CEBC-4910-B11A-242393EDF6D3} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{D793D5B1-A985-4443-90F4-E55A13CFF117} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{E98E94E2-12D1-48E5-AC69-2C312F466136} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{806422F1-FC4E-4D7C-8855-05748AEFC031} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{27130E51-9555-408B-8134-7BFF54EDE27B} /qn REBOOT=REALLYSUPRESS
MsiExec.exe /X{3ED468C2-2235-4747-90AD-A7A34F0FE70A} /qn REBOOT=REALLYSUPRESS
taskkill /im SupportAssistAgent.exe /f /t
net stop SupportAssistAgent
sc delete SupportAssistAgent
rd "C:\Program Files\Dell\SupportAssist"/s /q
rd "C:\Program Files\Dell\SupportAssistAgent" /s /q
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PC-Doctor for Windows" /f
del "C:\Users\Public\Desktop\SupportAssist.lnk" /f /q

Sources: https://community.spiceworks.com/topic/2229972-using-pdq-deploy-to-uninstall-dell-supportassist https://www.dell.com/community/SupportAssist-for-PCs/Silently-Update-SupportAssist-in-background/td-p/7294483


虽然使用即将过时的命令行实用程序,但在PowerShell中运行这个程序是没有问题的。复制、粘贴、保存为.ps1扩展名...完成。虽然是老问题,但是答案很有用 :) - Architect Jamie

2

所以我遇到了完全相反的问题。我能够删除更新版本,但是任何返回“C:\Program Files\Dell\SupportAssist\uninstaller.exe /arp”作为UninstallString的内容都无法在自动化中成功,因为我无法让提示框不显示(我需要从大约700个代理中删除这些垃圾软件,有些代理上还安装了多个版本,所以我理解你的痛苦)。

对于更新版本,我使用了以下方法:

最初的回答

$SAVer = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall, HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall  |
    Get-ItemProperty |
        Where-Object {$_.DisplayName -match "SupportAssist" } |
        Where-Object {$_.DisplayVersion -notlike "3.2*"} | 
            Select-Object -Property DisplayVersion, UninstallString, PSChildName

ForEach ($ver in $SAVer) {

    If ($ver.UninstallString) {

        $uninst = $ver.UninstallString
        & cmd /c $uninst /quiet /norestart

    }
}

我将研究您展示的旧版本(2.0及更早版本)的方法,以查看是否解决了我的问题。希望我的代码片段能帮助您。干杯。

原始答案:最初的回答。


对我来说完美地工作了。为了简洁起见,我省略了版本部分。此外,我在一台机器上运行了该脚本,以确保它按预期工作,并发现 PSChildName 在所有工作站上都是相同的,因此我只使用了脚本中 cmd 部分的静态版本来运行所有工作站。对于任何好奇的人,在版本 3.3.3.13 上,您只需要运行一个批处理命令:MsiExec.exe /X{95BD6E30-2B18-4FB0-B5AE-8250E5584831} /quiet /norestart - Fumbles

0

我知道这是一个旧帖子,但我只是在寻找一个脚本来完成这个任务,最终我自己编写了一个Powershell脚本。

这就是我想出来的... 卸载 "Dell SupportAssist" 和 "Dell Update 的 Dell SupportAssist OS Recovery 插件" 希望这也能帮助其他人.. 代码可能需要进行一些清理或简化,但对我来说它起作用了。


$supportassist = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall| Get-ItemProperty | Where-Object {$_.DisplayName -ceq "Dell SupportAssist" } | Select-Object -ExpandProperty UninstallString
if ($supportassist)
{
    $arguments = $supportassist.substring(12) + " /qn REBOOT=REALLYSUPRESS"
    echo "Uninstalling Dell SupportAsist"
    echo "msiexec.exe " $arguments
    (Start-Process "msiexec.exe" -ArgumentList $arguments -NoNewWindow -Wait -PassThru).ExitCode
}

$supportassist2 = Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall| Get-ItemProperty | Where-Object {$_.DisplayName -ceq "Dell SupportAssist OS Recovery Plugin for Dell Update" } | Select-Object -ExpandProperty UninstallString
if ($supportassist2)
{
    $arguments2 = $supportassist2.substring(12) + " /qn"
    echo "Uninstalling Dell SupportAssist OS Recovery Plugin for Dell Update"
    echo "msiexec.exe " $arguments2
    (Start-Process "msiexec.exe" -ArgumentList $arguments2 -NoNewWindow -Wait -PassThru).ExitCode
}

0

这是我目前使用的一个PowerShell脚本,用于删除它

Param (
    [Parameter(Mandatory=$false)]
    [switch]$Force = $false,
    [Parameter(Mandatory=$false)]
    [String] $SoftwareVersion = "3.11"
)

$Software = "Dell SupportAssist"
$ScriptName = $myinvocation.MyCommand
Function Remove-CachedScripts {


    $Agent = "C:\Program Files\N-able Technologies\Windows Agent"

    if (test-path "C:\Program Files (x86)\N-able Technologies\Windows Agent") {
        $Agent = "C:\Program Files (x86)\N-able Technologies\Windows Agent"
    }
    remove-item "$Agent\cache\$scriptname" -force -erroraction SilentlyContinue
    remove-item "$Agent\Temp\Script\$scriptname"  -force -ErrorAction SilentlyContinue
}
Function Get-InstalledApp($Target) {
    $Apps = @()
    
    $Apps += Get-ChildItem -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall  |
           Get-ItemProperty | Where-Object {$_.DisplayName -eq "$Target" } | Select-Object -Property DisplayName, DisplayVersion, UninstallString
           
                
    If ($(Get-WmiObject Win32_OperatingSystem).OSArchitecture -match "64") {
        $Apps += Get-ChildItem -Path HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall  |
           Get-ItemProperty | Where-Object {$_.DisplayName -eq "$Target" } | Select-Object -Property DisplayName, DisplayVersion, UninstallString
        }
        
    $Apps
}

Function Uninstall-Software {

    if ($SoftwareUninstall -ne $null) {
       
        if (($($SoftwareUninstall.DisplayVersion) -ge "$SoftwareVersion") -and ($force -eq $false)) {

            exit 0
        }


        if ($($SoftwareUninstall.DisplayVersion) -lt "$SoftwareVersion") {

            }
                    ForEach ($item in $SoftwareUninstall) {
                        if (($item.displayversion -le "$softwareversion") -or ($force -eq $true)) {
                        

                        If ($item.UninstallString) {
                        
                            $uninst = $item.UninstallString.Split('/X')[0]
                            $guid = $item.UninstallString.Split('/X')[2] 
                            $argument = "/x $guid /qn /norestart"
                            
                            
                            Start-Process $uninst -ArgumentList "$argument" -wait -passthru -NoNewWindow
                            
                            $Timeout = 0
                            $MaxWait = 10 
                            
                            While (($CheckSoftware -ne $null) -and ($Timeout -lt $MaxWait)) { 
                                Start-Sleep -Seconds 30
                                $Timeout++
                                
                                $CheckSoftware = Get-InstalledApp("$Software")
                            }

                            If ($CheckSoftware -eq $null) 
                                {
                                        Exit 0
                                } 
                    }
                }
            }
        } 
}

 
$SoftwareUninstall = . Get-InstalledApp($software)
. Uninstall-Software
Remove-CachedScripts

0

你尝试过类似这样的东西吗:

get-package *dell* | uninstall-package -whatif

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接