Author Posts

May 31, 2015 at 10:00 pm

Need to get installed apps from several computers in my network, i'm specifically looking for SQL presence on a list of servers.

I would like to get some help with the code that will take the server names from a text file and do a search for SQL based on the file and out-put that info to a text file that will organize it by server name and app installed.

Thanks

May 31, 2015 at 10:16 pm

Hi Angel,

Have you searched using Google or Bing for PowerShell scripts related to your problem?

Regards
Daniel

June 1, 2015 at 6:24 am

Angel,

You can try something like this:

Get-WmiObject -Class Win32_Product -ComputerName NY7D20360 | Where-Object {$_.Name -eq "Microsoft Silverlight"}

You can use also use remoting. My company doesn't allow me to enable remoting for security reason. In -ComputerName you can read from a text file and list all the server names. Rememeber to use test-connection first to make sure the server is up. Change the "Microsoft Silverlight" to the product name you are seaching for.

Thanks
Freddy

June 3, 2015 at 8:01 am

Hi Angel,
Here is how I used to do the same,

Get-WmiObject win32_product -ComputerName .\computers.txt|?{$_.name -like "*sql*"}|select @{E="pscomputername";L="ComputerName"},@{E="name";L="AppName"}|Out-File C:\Users\$env:username\desktop\installedapps.txt

You can do the sam to csv too...

Get-WmiObject win32_product -ComputerName .\computers.txt|?{$_.name -like "*sql*"}|select @{E="pscomputername";L="ComputerName"},@{E="name";L="AppName"}|export-csv  C:\Users\$env:username\desktop\installedapps.csv-notypeinformatio}

Regards,.
KVPRASOON