IE version collection with PowerShell

Task for IT: collect statistic about IE versions in your environment without inventory system.

What you need to enable: Remote registry on computers

Run PowerShell script:

#Script is writen by: Mykola Korkishko and Andryi Svintsitsky

$array =@()
 $keyname = 'SOFTWARE\\Microsoft\\Internet Explorer'
 $today = Get-Date
 $cutoffdate = $today.AddDays(-30)

$computernames = Get-ADComputer -Properties * -Filter {LastLogonDate -gt $cutoffdate}
 foreach ($server in $computernames)
 {
 $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $server.name)
 $key = $reg.OpenSubkey($keyname)
 $value = $key.GetValue('Version')
 $obj = New-Object PSObject

$obj | Add-Member -MemberType NoteProperty -Name "ComputerName" -Value $server.name

$obj | Add-Member -MemberType NoteProperty -Name "IEVersion" -Value $value
 $array += $obj
 }
 $array | select ComputerName,IEVersion | export-csv IE_Version.csv
Advertisements

About nicoljako

Cofounder Kresalo., sysadmin, architect of IT infrastructures
This entry was posted in Windows Server and tagged , , . Bookmark the permalink.

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