How to format-list of installed programs grouped by computer name
hello,
i trying write powershell cmdlet search through computers on network , list applications installed on each computer. want output data using format-table (only needs list name , version). getting stuck on how group computer name, that.
below test code working extent won't seem show computer 1 > list of install applications, computer 2 > list of installed applications.
#variables $computername = $env:computername #main get-wmiobject -class win32_product -computername computer1, computer2 | select-object name, version, $computername | sort-object name | ft -property name, version -groupby $computernamethanks
something looking export info c:\temp , create file called apps.csv:
$computers = @('name of computer1','name of computer2') foreach ($computer in $computers) { get-wmiobject win32_product -computer $computer | select-object pscomputername,name,version | sort-object pscomputername | export-csv c:\temp\apps.csv -append }
change export path , file name whatever wish.
a warning though - using get-wmiobject win32_product against multiple remote computers may have impact on network , computers gathering information from. also, may not return installed software on computers run on.
Windows Server > Windows PowerShell
Comments
Post a Comment