Ying Li at myITforum.com

PowerShell & System Center

PowerShell script to check Windows Installer (msi.dll) version

Let’s say you need to find out the Windows Installer version on multiple remote machines. If you have SMS in place, this should be an easy task. You can create a dynamic query collection. But what happens if you don’t have SMS in your environment? I wrote a PowerShell script to accomplish this task. Query remote computer for msi.dll (this applies to any interested files) fileversion.

$erroractionpreference = "SilentlyContinue"

$a = New-Object -comobject Excel.Application
$a.visible = $True

$b = $a.Workbooks.Add()
$c = $b.Worksheets.Item(1)

$c.Cells.Item(1,1) = "Machine Name"
$c.Cells.Item(1,2) = "File Name"
$c.Cells.Item(1,3) = "Version"
$c.Cells.Item(1,4) = "Report Time Stamp"

$d = $c.UsedRange
$d.Interior.ColorIndex = 19
$d.Font.ColorIndex = 11
$d.Font.Bold = $True

$intRow = 2

$colComputers = get-content C:\Temp\Machinelist.txt

foreach ($strComputer in $colComputers)
{
$c.Cells.Item($intRow,1)  = $strComputer

Function GetFileInfo
{

$Path = "\\"+ $strComputer + "\C$\Windows\System32\msi.dll"

$File = get-item $Path

$c.Cells.Item($intRow,2)  = $File.Name
$c.Cells.Item($intRow,3)  = $File.VersionInfo.Productversion
}

GetFileInfo

$c.Cells.Item($intRow,4) = Get-date

 
$intRow = $intRow + 1
}

$d.EntireColumn.AutoFit()

Posted: Jan 09 2008, 07:32 PM by yli628 | with 8 comment(s)
Filed under:

Comments

dvdclone said:

The steps to fix registry on computer is not as easy as 1- 2- 3. But it is not as complicated as fixing cars either. To fix registry on computer is to simply change the registry information back to its default setting or to repair any errors incurred

# March 31, 2008 9:26 PM

dvd burning said:

Fortunately, we can strip this down for the sake of a simple test. We’ re using a local target so step 1 is unnecessary. We can also hard- code the MAC of the target machine, to also skip steps 2 to 4. An ICMP ECHO request packet can then be constructed

# June 14, 2008 5:13 PM

dvd copy software said:

my del. icio. us Categories 3D Ableton Live Business Development Displays DJing Entrepreneurialism Firefox Games Google Graphics iPhone Mash Ups Medicine Mobile Music News Philosophy PHP Physics Plugins Producing Real Estate RSS Science Star Trek Tablet

# June 15, 2008 4:06 AM

dvd decoders for xp said:

Many a times it happens, we install any software and find that a spyware has hit our computer. We wish to undo the install anyhow, but find ourselves helpless. However this undo can be done by creating restore points in windows. Restore point records

# June 15, 2008 6:02 AM

decrypter for dvd said:

scan IP address , scan your TCP/ UDP ports , scan several specifically popular TCP/ UDP ports.

# June 15, 2008 7:07 AM

record to a dvd said:

And last but not least. A camera. My little pocket rocket is about to give up the ghost. I’ ve noticed that the focus is off in the bottom left corner and sometimes it just won’ t focus at all. I’ ve tried cleaning the lense but I think it’ s something

# June 15, 2008 9:07 AM

shrink dvd size said:

Recent Posts \"Crawling\" Toward SDL SDL and Web 2. 0 The First Step on the Road to More Secure Software is admitting you have a Problem Wrapping up Threat Modeling More trustworthy election systems via SDL?

# June 16, 2008 10:00 AM

www.easiestdvdripper.com said:

Further, the default installs take considerably different amounts of RAM to run. XP takes 43. 15MB to run, Vista takes 235MB ( five times as much). And that’ s not including the system cache. In total, on a default install, XP consumes 207MB and Vista

# June 18, 2008 12:12 PM