Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
Using PowerShell to find your OS and SP levels
December 30, 2014
You can use PowerShell to quickly display your server’s OS and SP levels. The following example shows how you how you can use the Get-WmiObject cmdlet to retrieve you server’s name, operating system, x86 architecture type and major service pack level.
# Get Operating System Info
$sServer = "myserver"
$sOS =Get-WmiObject -class Win32_OperatingSystem -computername $sServer
foreach($sProperty in $sOS)
{
write-host $sProperty.Description
write-host $sProperty.Caption
write-host $sProperty.OSArchitecture
write-host $sProperty.ServicePackMajorVersion
}
You May Also Like