Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

PENDING Uninstall firefox Using SCCM

araimondi

Well-Known Member
Messages
78
Reaction score
2
Points
8
I was wondering if anyone knew of a good script to uninstall Firefox on all machines using sccm even if it wasn't installed by sccm and all versions of Firefox
 
The problem is "uninstalling" Firefox. It is not as simple as just run the uninstall via sccm. Does not work. Mozilla did not create typical MSI package. Does not abide by Microsoft rules. Need a powershell script to uninstall or remove ALL versions from one or several possible locations to be deployed with SCCM
 
The problem is "uninstalling" Firefox. It is not as simple as just run the uninstall via sccm. Does not work. Mozilla did not create typical MSI package. Does not abide by Microsoft rules. Need a powershell script to uninstall or remove ALL versions from one or several possible locations to be deployed with SCCM
Did you try the uninstall listed within this one too? Step 7.
 
I was wondering if anyone knew of a good script to uninstall Firefox on all machines using sccm even if it wasn't installed by sccm and all versions of Firefox
@araimondi,

Please try this PowerShell script, It will help you uninstall the existing version of Mozilla Firefox from all workstations. Note that before executing this script you should test in a single machine and then execute in whole machines.

Code:
# Define the list of computers in the domain
$computers = Get-ADComputer -Filter * | Select-Object -ExpandProperty Name

# Loop through each computer and uninstall Mozilla Firefox
foreach ($computer in $computers) {
    Write-Host "Uninstalling Mozilla Firefox from $computer" -ForegroundColor Yellow
    
    # Execute uninstallation command remotely
    Invoke-Command -ComputerName $computer -ScriptBlock {
        # Check if Mozilla Firefox is installed
        $firefox = Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object { $_.DisplayName -eq "Mozilla Firefox" }
        
        if ($firefox) {
            # Uninstall Mozilla Firefox
            Start-Process "C:\Program Files\Mozilla Firefox\uninstall\helper.exe" -ArgumentList "/S"
            Write-Host "Mozilla Firefox has been uninstalled." -ForegroundColor Green
        } else {
            Write-Host "Mozilla Firefox is not installed on this computer." -ForegroundColor Yellow
        }
    }
}

Once you successfully uninstall Firefox, download the Mozilla Firefox MSI installer from the official website then create an application package and deploy the same into workstations. URL given below,

Firefox MSI Package
 
I am also looking for assistance to uninstall Google Chrome on about 400 workstations. Google Chrome was not installed by SCCM.
@Zaza4Star,
Please try this PowerShell script, It will help you uninstall the existing version of Google Chrome from all workstations in your domain. Note that before executing this script you should test in a single machine or a testing environment and then execute in whole machines.

Code:
# Define the list of computers in the domain
$computers = Get-ADComputer -Filter *

# Define the command to uninstall Chrome
$uninstallCommand = {
    $chromeDisplayName = "Google Chrome"
    $uninstallString = (Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*" | Where-Object {$_.DisplayName -eq $chromeDisplayName}).UninstallString
    if ($uninstallString) {
        Start-Process -FilePath $uninstallString -ArgumentList "/S" -Wait
        Write-Host "Google Chrome has been uninstalled successfully on $($env:COMPUTERNAME)" -ForegroundColor Green
    } else {
        Write-Host "Google Chrome is not installed on $($env:COMPUTERNAME)" -ForegroundColor Yellow
    }
}

# Execute the uninstall command on each computer
foreach ($computer in $computers) {
    $session = New-PSSession -ComputerName $computer.Name
    Invoke-Command -Session $session -ScriptBlock $uninstallCommand
    Remove-PSSession -Session $session
}

Once you successfully uninstall Chrome, download the Chrome Enterprise MSI installer from the official website then create an application package and deploy the same into workstations. URL given below,

Chrome Enterprise
 
Back
Top