Need help with script to remove FireFox Browser from all computers

I need help writing a script to remove firefox. I've provided what I've written so far. What I can't figure out is how to deploy this script to remote computers. I know I can use GPOs and psexec but I'd like the whole solution to be PowerShell if possible.
Pedro RiveraAsked:
Who is Participating?
 
Hasin Ahmed ChoudharyConnect With a Mentor Exchange AdministratorCommented:
Try this: It will need remote powershell enabled for client compouters.

Replace application name with "Eyes Relax"

Invoke-Command -ComputerName "Some Computer" -ScriptBlock {
    $app = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -match "eyes relax" } 
    $app.Uninstall()
}

Open in new window

0
 
Sam Simon NasserConnect With a Mentor IT Support ProfessionalCommented:
check this https://www.safaribooksonline.com/library/view/windows-powershell-cookbook/9780596528492/ch24s07.html
PS > $software = Get-InstalledSoftware UnwantedProgram
	PS > cmd /c $software.UninstallString

Open in new window

Alternatively, use the Win32_Product WMI class for an unattended installation:

      
$application = Get-WmiObject Win32_Product -filter "Name='UnwantedProgram'"
	$application.Uninstall()

Open in new window

0
 
Vikas BhatExperienced IT Infrastructure Services/operations ManagerCommented:
I like to keeps things simple as long as they work.

Just copy/paste lines below into a CMD file and run it as Administrator. You can send it to multiple computers as well.

WMIC product where "Name LIKE 'Mozilla Firefox'" call uninstall /nointeractive
0
 
Shaun VermaakTechnical Specialist/DeveloperCommented:
I know I can use GPOs and psexec but I'd like the whole solution to be PowerShell if possible.
Why not use AppLocker to block installation and existing Firefox EXEs?
0
 
Pedro RiveraAuthor Commented:
Thank you guys for your responses. I really appreciate the quick responses.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.