Monday, November 21, 2011

Find the List of Installed software using WMI and PowerShell.

 

Hi,

how you find the which software is installed on your computer, most of users answered  in “Control Panel” , yes it is right . but, if you are creating an Inventory of which system have which software then it’s not so useful for admins.

lets use WMI to retrieve the list of Install list of Softwares:

Cmdlet used: Get-WmiObject, Select-Object, Sort-Object, Export-CSV

Command is:

   1: Get-WmiObject win32_Product  | Select Name,Version,PackageName,Installdate,Vendor | Sort InstallDate -Descending

using Get-WmiObject cmdlet we query the win32_Product class which have the information of list of all software installations. Then we piped the command to Select cmdlet and we are selecting Name, Version, PackageName and installation date of the softwares and then pipe the command to Sort-Object cmdlet and sorting the result to descending order which mean latest first.


Software-1


let export the result to CSV for future reference using Export-CSV cmdlet.



   1: Get-WmiObject win32_Product  | Select Name,Version,PackageName,Installdate,Vendor | Sort InstallDate -Descending| Export-Csv d:\report.csv

 


all command is same but we piped the command further to Export-CSV cmdlet and saving the file to D:\ with name of Report.CSV


Software-2 





let see if this created a csv file .


Software-3


yes, file is created lets open it!!!


Done !!! seems good isn’t.


Software-4


 



Thanks for viewing


Aman Dhally

9 comments:

  1. How can we take a list of computers from a text file, and then parse that info through so we get results from 500+ computers?

    ReplyDelete
    Replies
    1. I think you can do this easily. You just need to twaek the script a little bit.

      thanks
      aman

      Delete
  2. Anonymous03 June, 2013

    This comment has been removed by a blog administrator.

    ReplyDelete
  3. Anonymous03 June, 2013

    Thanks Aman, I made a script for it with a for-each loop. It iterates through it and fetches the data. Here is the page.

    ReplyDelete
  4. Hi, can the user information ( user who installed the software) be retrieved ?

    ReplyDelete
  5. Hi,

    I treid this one and it works fine for all windows installer softwares,
    BUT I could get no info about NON-wmi software installed (for example vlc, winzip etc)

    what do you suggest about this issue?

    Thanks,
    Skender

    ReplyDelete
  6. Hi,

    same issue for me.
    what about other installers software (non .msi)?


    cheers
    Kollcaku

    ReplyDelete
  7. ...
    In fact as I see the list of packages from the csv/excel list, I see only .msi files and no other types...

    ReplyDelete

Note: Only a member of this blog may post a comment.