I track my client computers' software inventories in Spiceworks, and it was easy enough to get a report from Spiceworks showing who had what, but I don't track my servers in Spiceworks. For that, I needed a script to go through a list of my servers and tell me what version of IE they were running. I found a couple of script online, but they weren't to my liking. Some gave me inaccurate info, even. But they did point me to which registry tree I should look at, so I made my own, and here it is:
#=====================BEGIN SCRIPT==========================
$Computers = Get-content "C:\Temp\QueryInternetExplorerVersionsComputerList.txt"
$TempFile = "C:\Temp\IEVersion.csv"
$Delimiter = ","
Foreach ($Computer in $Computers){
$Version = (Invoke-Command -computername $Computer {$reg = Get-Item ('HKLM:\Software\Microsoft\Internet Explorer'); $reg.GetValue("svcVersion")})
$Computer + $Delimiter + $Version + $Delimiter | add-content $Tempfile
}
#=====================END SCRIPT==========================
- So, what we're doing here is as follows:
- Get the list of computers from a text file
- Specify a TempFile for output
- Specify a delimiter
- For each computer in the list, pull the SrcVersion value from the registry
- Combine the Computername and SrcVersion, along with use of the delimiters to make a CSV file, which I can then import into Excel.
- .....
- Profit!
Good luck and Godspeed, my fellow admins!
No comments:
Post a Comment