I needed a nice easy script to output the version number of Exchange 2003 to i can see what Server Pack is installed

I have tried this on a few machines and it seems to be working, i am testing more now, fingers crossed.

Const HKEY_LOCAL_MACHINE = &H80000002 
 
strComputer = “.” 
Set objRegistry = GetObject(“winmgmts:” & strComputer & “rootdefault:StdRegProv”) 
 
 Dim strComputer, objWMIService, colSettings, objProcessor

strComputer = “.”

Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate,authenticationLevel=Pkt}!” _
& strComputer & “rootcimv2”)

strKeyPath = “SOFTWAREMicrosoftExchangeSetup”
 
strValueName = “ServicePackBuild”  
objRegistry.GetdwordValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue 
 
If IsNull(dwValue) Then 
    Wscript.Echo “Cant find Exchange 2003” 
WScript.Quit(1)  
 
elseIf (dwValue) >= “7638” Then
  Wscript.Echo “Upgrade not Reqired SP2 installed(” & dwValue & “)”  
WScript.Quit(0) 
 
Else 
    Wscript.Echo “Upgrade to Exchange 2003 SP2 Required  (” & dwValue & “)” 
WScript.Quit(1)  
End If

Let me know how it goes for you

« »