hello
Google
Welcome to Carpe Diem: Flaphead@Home Sign in | Join | Help

Carpe Diem: Flaphead.com

Seize the Day

News


  • Add to Technorati Favorites <script type="text/javascript" src="http://technorati.com/embed/3ni3q36ikc.js"> </script>
    This information is provided "AS IS" with no warranties, and confers no rights. Also some of the information contains my views and thoughts.
    <script src="http://widgets.technorati.com/t.js" type="text/javascript" charset="UTF-8"></script>

    Add Me! - Search Engine Optimization

    I heart FeedBurner

Exchange 2007 Update Rollups

So as you have read I have been playing with the two Update Rollups (1, 2)and the one things that gets me is that you have no way of knowing what patches are applied on what servers.

Until now ;-) So I have written some PowerShell that will get a list of all your Exchange 2007 with the exception of Edge servers.  It then uses WMI to connect to the servers registry and dump the Patches Registry key.  You can see the key here:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\461C2B4266EDEF444B864AD6D9E5B613\Patches

So the output looks like this:

[PS] C:\PS>.\Get-ExchangeServerPlus.ps1

CAS01 [ClientAccess] [Standard] 8.0.535.0
- 20070418:  Update Rollup 1 for Exchange Server 2007 (KB930809) 8.0.708.3

CAS02 [ClientAccess] [Standard] 8.0.535.0
- 20070509:  Update Rollup 2 for Exchange Server 2007 (KB935490) 8.0.711.2

HUB01 [HubTransport] [Standard] 8.0.535.0
- 20070419:  Update Rollup 1 for Exchange Server 2007 (KB930809) 8.0.708.3
- 20070509:  Update Rollup 2 for Exchange Server 2007 (KB935490) 8.0.711.2

HUB02 [HubTransport] [Standard] 8.0.535.0
- 20070419:  Update Rollup 1 for Exchange Server 2007 (KB930809) 8.0.708.3

MBX01 [Mailbox] [Enterprise] 8.0.535.0
- 20070418:  Update Rollup 1 for Exchange Server 2007 (KB930809) 8.0.708.3

MBX03 [Mailbox] [Standard] 8.0.535.0
- 20070424:  Update Rollup 1 for Exchange Server 2007 (KB930809) 8.0.708.3

[PS] C:\PS>

Here is the code,  I need to sort out a bit or error handling but it works!


#Get-ExchangeServerPlus.ps1
#v1.0 9th May 2007
#Written By Paul Flaherty
#blogs.flaphead.com


#Get a list of Exchange Server in the Org excluding Edge servers
$MsxServers = Get-ExchangeServer | where {$_.ServerRole -ne "Edge"} | sort Name


#Loop each Exchange Server that is found
ForEach ($MsxServer in $MsxServers)
{

    #Get Exchange server version
    $MsxVersion       = $MsxServer.ExchangeVersion

    #Create "header" string for output
    # Servername [Role] [Edition] Version Number
    $txt1 = $MsxServer.Name + " [" + $MsxServer.ServerRole + "] [" + $MsxServer.Edition + "] " + $MsxVersion.ExchangeBuild.toString()
    write-host $txt1

    #Connect to the Server's remote registry and enumerate all subkeys listed under "Patches"
    $Srv = $MsxServer.Name
    $key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\461C2B4266EDEF444B864AD6D9E5B613\Patches\"
    $type = [Microsoft.Win32.RegistryHive]::LocalMachine
    $regKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($type, $Srv)
    $regKey = $regKey.OpenSubKey($key)

    #Loop each of the Subkeys (Patches) and gather the Installed date and Displayname of the Exchange 2007 patch
    Foreach($sub in $regKey.GetSubKeyNames())
    {
        Write-Host "- " -nonewline
        $SUBkey = $key + $Sub
        $SUBregKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($type, $Srv)
        $SUBregKey = $SUBregKey.OpenSubKey($SUBkey)

        Foreach($SubX in $SUBRegkey.GetValueNames())
        {
            # Display Installed date and Displayname of the Exchange 2007 patch
            IF ($Subx -eq "Installed")   {Write-Host $SUBRegkey.GetValue($SubX) -NoNewLine}
            IF ($Subx -eq "DisplayName") {write-Host ": "$SUBRegkey.GetValue($SubX)}
        }
    }
        write-host ""
}

 

I will upload the zip in a couple of hours when I get home and this link will become alive 

Hope this helps.   Let me know if you have any feedback

Posted: 09 May 2007 16:46 by Paul Flaherty

Comments

Carpe Diem: Flaphead.com @ Home said:

Agggggggg this is damm anoying but I managed to work it out. Basically I have the following: DMZ - HUB01,

# May 29, 2007 13:41

Microsoft UK UC Blog said:

Over the last 12 months I have had various occasions where I needed to quickly check the store.exe version

# April 26, 2009 22:25

Microsoft UK UC Blog said:

Over the last 12 months I have had various occasions where I needed to quickly check the store.exe version

# April 30, 2009 11:32
New Comments to this post are disabled