We help IT Professionals succeed at work.

powershell to uninstall a program on a remote computer.

nav2567
nav2567 asked
on
Hello,

I have a CSV file which list of computers.  

May someone advise a PS script to read the file and perform and do the uninstall on each computer? msiexec.exe /x ProductCode

Thanks,
Comment
Watch Question

Senior Systems Admin
CERTIFIED EXPERT
Top Expert 2010
Commented:
Easy enough...
$comps = import-csv <csv file>
foreach ($comp in $comps){invoke-command -computer $comp.name -scriptblock {msiexec /x productcode}}

Open in new window


You'll need to make sure the first line of your CSV file is "name"