MSExchangeGuru.com

Learn Exchange the Guru way !!!

 

Check Exchange 2010 Rollup Version

One issue that we’ve all probably experienced as an Exchange 2010 administrator is verifying that a Rollup Update, or RU/UR/Rollup/Update Rollup/CU/Cumulative Update/whatever you like to call it, is the version that it’s supposed to be after you install an update.

It’s the first step of your post install test plan (or at least it should be) in verifying that your update was installed successfully. In Exchange 2003 and previous versions, all updates were packaged as service packs and could easily be found in the build number. Since Exchange 2007, all Exchange platforms have service packs AND rollup updates. Unfortunately, finding the rollup update build number for a multiple server environment can be cumbersome.

You can open the EMC and check Help > About Exchange Management Console, or you can go to the Control Panel and check which update is installed, or you can run

Get-Command Exsetup.exe | ForEach-Object {$_.FileVersionInfo}

but that only checks the server you’re logged into and if you have a 50 server environment like I do, that would take far too long. Unless you setup a remote PowerShell session this is still too much work. Below is a script that will check every server in your environment by checking the registry for the Exchange install path and then check the version number of the ExSetup.exe. This script is very versatile, especially if you have Exchange installed on different drives for different server roles (i.e. HUB servers may have Exchange installed on a different drive to account for queue backup, etc.,). Additionally, it spits out a handy CSV with Server Name, Server Role, Install Path, and File Version. Now go forth, and update your Exchange 2010 environment with confidence!

###CODE BELOW###

$report = @()
$servers = get-exchangeserver

foreach ($server in $servers)
{
$Servername = $server.Name
$role = $server.serverrole
$reg = $null
$reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(“LocalMachine”,$server)
$installpath = $reg.OpenSubKey(“SOFTWARE\Microsoft\ExchangeServer\v14\Setup”).GetValue(“MsiInstallPath”)
$installpath = $installpath + “bin\ExSetup.exe”
$newpath = $installpath -replace ‘:’,’$’
$newpath = “\\$servername\” + $newpath
$fileversion = (Get-Command $newpath).FileVersionInfo |ForEach {$_.FileVersion}

$serverObj = New-Object PSObject
$serverObj | Add-Member NoteProperty -Name “Server Name” -Value $servername
$serverObj | Add-Member NoteProperty -Name “Server Role” -Value $role
$serverObj | Add-Member NoteProperty -Name “Install Path” -Value $newpath
$serverObj | Add-Member NoteProperty -Name “Rollup Version” -Value $FileVersion

$report += $serverObj
}

$report | export-csv “VersionCheck.csv” -notypeinformation

CODE END###

By Doug Spear
MSExchangeGuru.com
Team@MSExchangeGuru

Leave a Reply

ad

Categories

Archives