Software Inventory in VS .NET

Drawer Code 3/9 in VS .NET Software Inventory
Software Inventory
Code 39 Generation In .NET
Using Barcode generation for Visual Studio .NET Control to generate, create Code-39 image in Visual Studio .NET applications.
The class Win32_Product delivers the installed MSI packages:
Scanning Code 3 Of 9 In .NET
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in .NET applications.
Get-Wmiobject Win32_Product
Creating Bar Code In .NET
Using Barcode encoder for Visual Studio .NET Control to generate, create bar code image in .NET applications.
Of course, you can lter The following command lists only those MSI packages whose names start with the letter A:
Bar Code Recognizer In VS .NET
Using Barcode decoder for .NET Control to read, scan read, scan image in .NET framework applications.
Get-Wmiobject Win32_Product | where-object { $_name -like "a*" }
Encode Code-39 In C#.NET
Using Barcode creator for .NET Control to generate, create Code 39 image in Visual Studio .NET applications.
The second lter extracts all MSI packages with Microsoft as producer:
Painting Code 3/9 In VS .NET
Using Barcode creator for ASP.NET Control to generate, create Code-39 image in ASP.NET applications.
Get-Wmiobject Win32_Product | where-object { $_vendor -like "microsoft*" }
Encoding ANSI/AIM Code 39 In VB.NET
Using Barcode drawer for Visual Studio .NET Control to generate, create Code 3 of 9 image in .NET applications.
13 Registry and Software
Encoding Code-39 In Visual Studio .NET
Using Barcode generator for .NET framework Control to generate, create Code 3/9 image in .NET applications.
You can also nd out whether a certain application has been installed: Listing 132 Checking Whether QuickTime Version 720240 Is Installed on a Speci c
Make ECC200 In VS .NET
Using Barcode generator for Visual Studio .NET Control to generate, create Data Matrix ECC200 image in Visual Studio .NET applications.
Computer
Generate Barcode In .NET
Using Barcode drawer for .NET Control to generate, create barcode image in VS .NET applications.
######################################## # The PowerShell script checks if a certain software is installed # (C) Dr Holger Schwichtenberg ######################################## function Get-IsInstall($Application, $Computer, $Version) { $a = (Get-WmiObject -Class Win32_Product -Filter "Name='$Application' and Version='$Version'" -computername $Computer) return ($a -ne $null) } $e = Get-IsInstall "QuickTime" "E01" "720240" if ($e) { "Software is installed!" } else { "Software is not installed!" }
GS1 128 Drawer In Visual Studio .NET
Using Barcode printer for VS .NET Control to generate, create EAN 128 image in .NET applications.
In a pipeline command, you can also write a complete inventory resolution, which consecutively, according to a list in a text le, calls several computers and then exports the found applications to a CSV le:
RM4SCC Drawer In .NET Framework
Using Barcode creator for Visual Studio .NET Control to generate, create British Royal Mail 4-State Customer Code image in .NET framework applications.
get-content "computernametxt" | foreach { get-wmiobject win32_product -computername $_ } | where { $_vendor -like "*Microsoft*" } | export-csv "Softwareinventorycsv" notypeinformation
Barcode Decoder In .NET
Using Barcode decoder for VS .NET Control to read, scan read, scan image in .NET framework applications.
You can even re ne the inventory resolution by checking, before accessing the computer, with a ping whether it is even accessible to prevent the long timeout of WMI Because a pipelining command is not suf cient for this task and you need a script, you can instead parameterize the solution directly (see Listing 133)
USS Code 128 Encoder In Visual Basic .NET
Using Barcode generation for .NET framework Control to generate, create Code 128A image in VS .NET applications.
Software Administration
Paint Barcode In Java
Using Barcode generator for Java Control to generate, create barcode image in Java applications.
Listing 133 Software Inventory via WPS Script
Code 39 Full ASCII Creator In VS .NET
Using Barcode generator for ASP.NET Control to generate, create Code-39 image in ASP.NET applications.
######################################## # The PowerShell script inventories the installed software # of a producer on n computer systems # (C) Dr Holger Schwichtenberg ######################################## $Producer = "*Microsoft*" $Entry lename = "computernamestxt" $Output lename = "Softwareinventorycsv" # Import of computer names $Computernames = Get-Content "computernamestxt" $Computernames | foreach { if (Ping($_)) { Write-Host "Inventorize software for computer $_ " # Fetching of installed MSI packages on all computers $Software = foreach { get-wmiobject win32_product -computername $_ } | where { $_vendor -like $Producer } # Export in CSV $Software | export-csv "Softwareinventarcsv" -notypeinformation } else { Write-Error "Computer not accessible!" } } # Execute Ping function Ping { $status = Get-WmiObject Win32_PingStatus - lter "Address='$args[0]'" | select StatusCode return $statusStatuscode -eq 0 }
Printing Barcode In Visual Basic .NET
Using Barcode maker for .NET Control to generate, create bar code image in .NET framework applications.
13 REGISTRY AND SOFTWARE
Print EAN / UCC - 14 In .NET Framework
Using Barcode encoder for ASP.NET Control to generate, create UCC.EAN - 128 image in ASP.NET applications.
13 Registry and Software
Make Data Matrix 2d Barcode In Visual C#
Using Barcode generator for .NET framework Control to generate, create DataMatrix image in .NET framework applications.
Additional Information about Software
Generating Data Matrix In Java
Using Barcode creation for Java Control to generate, create ECC200 image in Java applications.
You get a list of all installed software updates (patches, hot xes) with the following:
Get-Wmiobject Win32_Quick xengineering
You can view the installed audio-/video codecs with this:
Get-Wmiobject Win32_CodecFile | select group,name
Non-MSI Applications
Win32_Product is valid only for applications that have been installed with
Windows Installer All applications that you can see in the system control can be displayed only via the registry key HKLM:\SOFTWARE\Microsoft\ Windows\CurrentVersion\Uninstall:
Get-ChildItem HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\ Uninstall
The access can be simpli ed by de ning a new WPS drive:
New-PSDrive -Name Software -PSProvider RegistrierungsDatabank -Root HKLM:\SOFTWARE\Microsoft\Windows\ CurrentVersion\Uninstall
Thereafter, you only have to write the following:
Get-ChildItem Software:
When ltering, you have to keep in mind that the properties (for example, DisplayName, Comments, and UninstallString) are not properties of the object of the type MicrosoftWin32RegistryKey, but subelements of this object (see Figure 134) Thus, GetValue() has to be used for the access to this data:
Get-ChildItem Software: | Where-Object -FilterScript { $_GetValue("DisplayName") -like "a*"} | ForEach-Object -Process {$_GetValue("DisplayName") , $_GetValue("Comments"), $_GetValue("UninstallString") }
Software Administration
13 REGISTRY AND SOFTWARE
Figure 134 Listing of installed software starting with the letter A
Autostart Applications
Programs that start automatically when the operating system is started can be found in the instances of the WMI class Win32_StartupCommand:
Get-Wmiobject Win32_StartupCommand
Installing Software
A script-based installation is possible for many applications; the processing, however, depends on the installation technology used Microsoft in WMI supplies installation support for installation packages based on MSI WMI permits the call of Microsoft Installer to install any MSI package (see Listing 134) The class Win32_Product offers the method Install() for this purpose The method expects three parameters:
The path to the MSI package Command-line parameters that are to be transferred to the package Whether an application will be installed for all users (True) or for the logged-in user only (False)
Keep in mind, however, that the Install() method is a static method of the WMI class Win32_Product A remote installation is possible