How to Find Windows Version on any computer machine and it is required to upgrade when your computer has an old version update, here are the simple steps on how to find windows version.
When you are supporting a large scale environment that has a mixed set of computers like servers and desktop machines with different operating systems and want to pull a report for windows version, then there are two ways we can pull the information as below.
Find Windows Version Using WMI
gwmi win32_operatingsystem | % caption #output PS C:\Windows\System32> gwmi win32_operatingsystem | % caption Microsoft Windows 10 Enterprise
Multiple Remote Computers
We need to create a file for storing all the servers or multiple machines list, I named itas Allservers.txt for and saved it in my local machine c:\temp\Allservers.txt
$Allserers = get-content -path "C:\temp\Allservers.txt" foreach ($oneserver in $allservers) { Write-host "currenty the Script is Running on"$oneserver Get-WmiObject -ComputerName $oneserver win32_operatingsystem | % caption }
Find Windows Version Using Registry
Sometimes the result using WMI is a bit slow, we can also get the Windows version using registry, here is the simple Powershell code.
$Version = Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\' $Version $Version.ProductName $Version.CurrentMajorVersionNumber
Thank you for reading this article, if you have any questions please let us know.
Thank you for visiting my site, for any scripts in these articles you are testing please make sure you have tested this script in our lower environment before you run in production.
Leave a Reply Cancel reply