I had pushed out Office 2007 using a GPO start up script with a custom .msp file to tweak the install the way we wanted it. The problem is that when it was originally installed we had Exchange 2003 server and now we have moved to Exchange 2007 with completely different server names. Since we had put in the server names in the .msp file, Outlook will now only look for those no existent Exchange 2003 servers. It’s default function is to query AD and find the Exchange 2007 server that hosts that user’s mailbox. So to fix this problem I have to uninstall the current install of Office 2007 and re-push it so we have a consistent install from all old installs and all future fresh installs.
So here is what I have done. Created a new .bat file for a new Office 2007 install GPO. Below is the script for checking for version/uninstall/install of Office.
@ECHO OFF
setlocal
REM *********************************************************************
REM Environment customization begins here. Modify variables below.
REM *********************************************************************
REM Get ProductName from the Office product’s core Setup.xml file.
set ProductName=ProPlus
REM Set DeployServer to a network-accessible location containing the Office source files.
set DeployServer=\\domain.com\dfs\AdminInstall\Microsoft\off2007
REM Set AdminFile to the custom MSP file
set AdminFile=\\domain.com\dfs\AdminInstall\Microsoft\off2007\Updates
REM Set LogLocation to a central directory to collect log files.
set LogLocation=\\domain.com\dfs\AdminInstall\Microsoft\off2007\Office12Logs
REM *********************************************************************
REM Deployment code begins here. Do not modify anything below this line.
REM *********************************************************************
IF NOT “%ProgramFiles(x86)%”==”" SET WOW6432NODE=WOW6432NODE\
reg query HKEY_LOCAL_MACHINE\SOFTWARE\%WOW6432NODE%Microsoft\Windows\CurrentVersion\Uninstall\%ProductName%
if %errorlevel%==1 (goto DeployOffice) else (goto CheckReinstall)
REM If 1 returned, the product was not found. Run setup here.
eployOffice
echo %date% %time% > c:\Office2007.txt
echo Installation of Office 2007 has begun. >> c:\Office2007.txt
start /wait %DeployServer%\setup.exe /adminfile %AdminFile%
REM echo %date% %time% Setup ended with error code %errorlevel%. >> %LogLocation%\%computername%.txt
REM if office is installed check to see if it has already been uninstalled.
:CheckReinstall
if exist c:\Office2007.txt goto End
echo %date% %time% > c:\Office2007.txt
echo Uninstall of Office 2007 has begun!
start /wait %DeployServer%\setup.exe /uninstall ProPlus /config \\domain.com\dfs\AdminInstall\Microsoft\off2007\ProPlus.WW\SilentUninstall.xml
echo %date% %time% Uninstall ended with error code %errorlevel%. >> c:\Office2007.txt
REM If 0 or other was returned, the product was found or another error occurred. Do nothing.
:End
Endlocal
The way this script works is as follows:
Check to see if the registry has entries for Office, if nothing in the registry create a file c:\Office2007.txt and start the install. This takes care of all new and future installs of Office.
If there is a registry entry, check to see if the file c:\Office2007.txt exists. If not, this means it is an old broken install and it is then uninstalled. At the end of uninstall the machine automatically reboots.
When the machine starts again, there is nothing in the registry so the new installation starts.
All future reboots will see that both a registry entry and the c:\Office2007.txt exists and it will dump out of the script.
I setup a temp OU and moved a department at a time into the new OU. This is done so that the entire company is not reinstalling Office at the exact same time, causing a slow down and possibly raising a large number of support calls to the IS Department.