{"id":239,"date":"2015-01-16T10:32:16","date_gmt":"2015-01-16T09:32:16","guid":{"rendered":"https:\/\/darkvoice.dyndns.org\/blog\/?p=239"},"modified":"2018-02-16T15:32:30","modified_gmt":"2018-02-16T14:32:30","slug":"check-the-version-including-update-rollup-of-all-exchange-servers-in-organization","status":"publish","type":"post","link":"https:\/\/ms07.de\/blog\/?p=239","title":{"rendered":"check the version including update rollup of all Exchange servers in organization"},"content":{"rendered":"<p><span id=\"result_box\" class=\"\" lang=\"en\"><span class=\"hps\">After I<\/span> <span class=\"hps\">realized that<\/span> <span class=\"hps\">there is no\u00a0Exchange 2010 cmdlet\u00a0<\/span><span class=\"hps\">to determine the<\/span> complet<span class=\"hps\">e<\/span> <span class=\"hps\">version number of<\/span> <span class=\"hps\">all Exchange servers<\/span><span class=\"\">, I decided to write a script for this.<br \/>\n<\/span><\/span><\/p>\n<p>The result is one ps1 script and a csv file with the version numbers and the version name. I got the version informations from this <a title=\"Article\" href=\"http:\/\/social.technet.microsoft.com\/wiki\/contents\/articles\/240.exchange-server-and-update-rollups-build-numbers.aspx\">Article<\/a>.<\/p>\n<p>The version csv looks like this:<\/p>\n<pre>Version,Text\r\n\"14.0.639.21\",\"Microsoft Exchange Server 2010 RTM\"\r\n\"14.0.682.1\",\"Microsoft Exchange Server 2010 RTM Update Rollup 1\"\r\n\"14.0.689.0\",\"Microsoft Exchange Server 2010 RTM Update Rollup 2\"\r\n.........\r\n\"14.3.210.2\",\"Microsoft Exchange Server 2010 SP3 Update Rollup 7\"\r\n\"14.3.224.2\",\"Microsoft Exchange Server 2010 SP3 Update Rollup 8-v2\"<\/pre>\n<p>To check the version, the script gets the installation path from registry and reads the file info of the exsetup.exe via smb (admin shares).<\/p>\n<p>And this is the script:<\/p>\n<pre># read versions and versiontext from csv\r\n$versions = @{}\r\n$csvversions = (Import-Csv -Path .\\get-ExchangeServerVersion.csv)\r\n$csvversions | foreach { $versions[($_.version)] = $_.Text }\r\n\r\n# create list object for output\r\n$output = @()\r\n\r\n$version =\"UNKNOWN!\"\r\n\r\n# get exchange servers in the organization filtered by version 14.*\r\n$exServers = Get-ExchangeServer | ? { $_.AdminDisplayVersion -like \"Version 14.*\"} | sort fqdn | select name,fqdn\r\nforeach ($exServer in $exServers){\r\n\u00a0\u00a0\u00a0 Write-Debug $exserver\r\n\u00a0\u00a0\u00a0 # create PowerShell object for output line\r\n\u00a0\u00a0\u00a0 $outputEx = New-Object -TypeName PSObject\r\n\r\n\u00a0\u00a0\u00a0 # get Exchange installation path\r\n\u00a0\u00a0\u00a0 $Reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $exServer.fqdn)\r\n\u00a0\u00a0\u00a0 $RegKey= $Reg.OpenSubKey(\"SOFTWARE\\\\Microsoft\\\\ExchangeServer\\\\V14\\\\Setup\")\r\n\u00a0\u00a0\u00a0 $InstallPath = $RegKey.GetValue(\"MsiInstallPath\")\r\n\u00a0\u00a0\u00a0 $ExSetupPath=(\"\\\\\"+$exServer.fqdn+\"\\\"+($InstallPath).replace(\":\\\",\"$\\\").Replace(\"\"\"\",\"\"))+\"bin\\ExSetup.exe\"\r\n\r\n\u00a0\u00a0\u00a0 # get Version from Exchange binary\r\n\u00a0\u00a0\u00a0 $version = ([Version](Get-Item ($ExSetupPath)).VersionInfo.ProductVersion).tostring()\r\n\r\n\u00a0\u00a0\u00a0 # add server name to ps object\r\n\u00a0\u00a0\u00a0 Add-Member -InputObject $outputEx -MemberType NoteProperty -Name Name -Value $exServer.fqdn\r\n\r\n\u00a0\u00a0\u00a0 # add version to ps object, if the version is not in the version list, use the version instead of text\r\n\u00a0\u00a0\u00a0 If($versions[\"$($version)\"]){\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Add-Member -InputObject $outputEx -MemberType NoteProperty -Name Version -Value $versions[\"$($version)\"]\r\n\u00a0\u00a0\u00a0 } else {\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Add-Member -InputObject $outputEx -MemberType NoteProperty -Name Version -Value $version\r\n\u00a0\u00a0\u00a0 }\r\n\r\n\u00a0\u00a0\u00a0 # reset Version to unknown for next loop\r\n\u00a0\u00a0\u00a0 $version =\"UNKNOWN!\"\r\n\u00a0\u00a0\u00a0 $ExSetupPath = \"\"\r\n\r\n\u00a0\u00a0\u00a0 # add ps object to output\r\n\u00a0\u00a0\u00a0 $output+=$outputEx\r\n\r\n}\r\n$output<\/pre>\n<p><strong>downloads<\/strong><\/p>\n<p><a href=\"https:\/\/ms07.de\/blog\/wp-content\/uploads\/2015\/01\/get-ExchangeServerVersion.ps1_.txt\">get-ExchangeServerVersion.ps1<\/a><a href=\"https:\/\/ms07.de\/blog\/wp-content\/uploads\/2015\/01\/get-ExchangeServerVersion.csv\"><br \/>\nget-ExchangeServerVersion.csv<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>After I realized that there is no\u00a0Exchange 2010 cmdlet\u00a0to determine the complete version number of all Exchange servers, I decided to write a script for this. The result is one ps1 script and a csv file with the version numbers and the version name. I got the version informations from this Article. The version csv [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[26,29,28,27],"class_list":["post-239","post","type-post","status-publish","format-standard","hentry","category-it","category-windows","tag-microsoft-exchange","tag-patch-level","tag-update-rollup","tag-version"],"_links":{"self":[{"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=239"}],"version-history":[{"count":6,"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/239\/revisions"}],"predecessor-version":[{"id":395,"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=\/wp\/v2\/posts\/239\/revisions\/395"}],"wp:attachment":[{"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ms07.de\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}