![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| | |||||||
| | Vista - how can I uninstall an application from multiple PC's? |
| |
| 12-01-2008 | #1 |
| | how can I uninstall an application from multiple PC's? Hi, I would like to uninstall an application from several PC's. I found the following script and it works great on the local PC, but I don't know how to add in a 'foreach', collection of PC names, etc. so it will run on the rest of the PC's. Can anyone assist? Thanks! $product = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -like "Avaya PDS Agent" } $product.Uninstall() |
| My System Specs |
| 12-01-2008 | #2 |
| | Re: how can I uninstall an application from multiple PC's? On Dec 1, 9:23*am, mmccormick <mmccorm...@xxxxxx> wrote: Quote: > Hi, I would like to uninstall an application from several PC's. I found the > following > script and it works great on the local PC, but I don't know how to add ina > 'foreach', collection of PC names, etc. so it will run on the rest of the > PC's. Can anyone assist? Thanks! > > $product = Get-WmiObject -Class Win32_Product | Where-Object { > $_.Name -like "Avaya PDS Agent" > > } > > $product.Uninstall() keep in mind that many uninstallers require user interaction: foreach ($computer in $computers) { $product = Get-WmiObject -Class Win32_Product -ComputerName $computer | Where-Object {$_.Name -like "Avaya PDS Agent"} $product.Uninstall() } |
| My System Specs |
| 12-01-2008 | #3 |
| | Re: how can I uninstall an application from multiple PC's? I would use -filter to only return back the exact program. This is much faster than using where-object{} to filter NOTE: win32_product only returns products installed using the Windows Installer and is not installed by default on Windows 2000 or 2003 and only returns a limited amount of info on XP. See here for more info: http://msdn.microsoft.com/en-us/libr...78(VS.85).aspx Brandon Shell --------------- Blog: http://www.bsonposh.com/ PSH Scripts Project: www.codeplex.com/psobject M> win32_product M> |
| My System Specs |
| 12-01-2008 | #4 |
| | Re: how can I uninstall an application from multiple PC's? Hi, This request looks is a bit simular to a script i use, i modified it slightly; A Script that reads a text file with computernames, tests if a computer is "pingable", tries to uninstall the software. Log all results per computer to a text file -- cut ----- function Remove-Apllication ($computer) { BEGIN {} PROCESS { $results = gwmi -query "SELECT * FROM Win32_PingStatus WHERE Address = '$computer'" if ($results.StatusCode -eq 0) { $ResultWMIQuery = Get-WMIObject -computerName $computer -query "select * from win32_Product where name='Avaya PDS Agent'" if ($ResultWMIQuery -ne $null) { $ResultWMIQuery.Uninstall() Write-Output "$computer Product uninstalled" | out-file "c:\Temp\ScriptOutPut.txt" -Append } else { Write-Output "$computer skipped (Product Not found)" | out-file "c:\Temp\ScriptOutPut.txt" -Append } } else { Write-Output "$computer skipped not Pingable" | out-file "c:\Temp\ScriptOutPut.txt" -Append } } END {} } gc c:\temp\computers.txt | %{Remove-Apllication $_} --- cut ---- NOT FULLY TESTED Sander Klaassen "mmccormick" <mmccormick@xxxxxx> wrote in message news:6CFFFDC8-1270-4DDE-BDAC-DED14CD5F86C@xxxxxx Quote: > Hi, I would like to uninstall an application from several PC's. I found > the > following > script and it works great on the local PC, but I don't know how to add in > a > 'foreach', collection of PC names, etc. so it will run on the rest of the > PC's. Can anyone assist? Thanks! > > > $product = Get-WmiObject -Class Win32_Product | Where-Object { > $_.Name -like "Avaya PDS Agent" > } > > $product.Uninstall() |
| My System Specs |
| 12-01-2008 | #5 |
| | RE: how can I uninstall an application from multiple PC's? Thank you very much for all the great info everyone. I went with Marco Shaw's advice and ran it this way: $comps="serverA","serverB" foreach($comp in $comps){ $prod=gwmi -computer $comp win32_product -filter "name = 'Avaya PDS Agent'" $prod.uninstall() } It ran like a champ! Thanks Marco and everyone for all your help! "mmccormick" wrote: Quote: > Hi, I would like to uninstall an application from several PC's. I found the > following > script and it works great on the local PC, but I don't know how to add in a > 'foreach', collection of PC names, etc. so it will run on the rest of the > PC's. Can anyone assist? Thanks! > > > $product = Get-WmiObject -Class Win32_Product | Where-Object { > $_.Name -like "Avaya PDS Agent" > } > > $product.Uninstall() |
| My System Specs |
![]() |
| Thread Tools | |
| |
| Similar Threads for: how can I uninstall an application from multiple PC's? | ||||
| Thread | Forum | |||
| Re: Uninstall application script | VB Script | |||
| How to uninstall stubborn (or corrupt) application? | Vista General | |||
| Cannot uninstall any application thru Programs and Features of Vis | Vista installation & setup | |||
| Parental Control W/Multiple PC's | Vista General | |||
| Uninstall an application using Powershell | PowerShell | |||