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
> 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()