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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hasin Ahmed ChoudharyExchange 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sam Simon NasserIT 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 IVCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.