PowerShell – Get Internet Explorer Version from Remote PC


Today a colleague asked me if there is a way to get the current Internet Explorer Version of multiple Remote PC´s (He needed to make sure that all these PC´s had at least Internet Explorer 9 so that his applications would run correctly.). Of course there is a way. I used PowerShell to solve this problem. I wrote a simple PowerShell Script which gets the Internet Explorer Version from the Remote PC´s Registry. Here it is:

Param([parameter(Mandatory=$true)][alias("Computer")]$ComputerName)

$Registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $ComputerName)
$RegistryKey= $Registry.OpenSubKey("SOFTWARE\\Microsoft\\Internet Explorer")
$Value = $RegistryKey.GetValue("Version")

$Value

The Script above will return the Version Number of the Remote PC´s Internet Explorer when you have the appropriate permissions.

Since I wanted to make my Script a bit more useful I created a function.


function Get-IEVersion
{
Param([parameter(Mandatory=$true)][alias("Computer")]$ComputerName)

$Registry = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $ComputerName)
$RegistryKey= $Registry.OpenSubKey("SOFTWARE\\Microsoft\\Internet Explorer")
$Value = $RegistryKey.GetValue("Version")

return $Value
}

And used my new function in another Script.


Param([parameter(Mandatory=$true)][alias("Computer")]$ComputerName)

Import-Module .\Get-InternetExplorerFunctions.ps1

Get-IEVersion $ComputerName

I gave my function to my colleague and he was happy that his problem was solved.

You can download the Scripts above from here.

Sources:

http://powershell.nicoh.me/powershell-1/os/change-a-value-in-a-remote-registry

Advertisements
Tagged

2 thoughts on “PowerShell – Get Internet Explorer Version from Remote PC

  1. Kimberley says:

    Every weekend i used to go to see this site, as i wish for enjoyment, for
    the reason that this this web site conations in fact good
    funny information too.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: