How to automate Microsoft Office 2007 installation
I was just updating some documentation on our wiki and found some old notes on automating Office 2007 installation. We upgraded our Microsoft Office software early last year from Office 2003 (and a few Office XP) to Office 2007 and this simple installation script saved us a lot of time. Here are the steps:
Step 1. Copy the contents of the Office 2007 installation CD (or package) to a network share (eg. \\server\Office12).
Step 2. Run the Office Customization Tool and create a setup customization file (I got these instructions from a BDD 2007 document on Microsoft’s website).
- Run the Office Customization Tool
- Go to Start->Run
- Type the following command: \\server\Office12\setup.exe /admin
- Create a setup customization file
- In Office Customization Tool, Click OK to create a new setup file.
- Specify the Installation Path, Organization Name
- Add the network share location of the Office 2007 Installation Files Shared Folder.\\server\Office12
- Specify the Product Key and Accept the License Agreement. And Modify the Display Options.
- Configure other options
- Finally, Click File, Save As, and save the Setup Customization File to Office12\Updates Folder
- Close the Office Customization Tool
Step 3. Download and install PowerShell.
Step 4. Download and install PsExec.
Step 5. Open a text editor (WordPad or Notepad is fine) and use the sample script below. Save the file asoffice_2007_install.ps1.
$hostname = “comp1″,”comp2″,”comp3″
foreach ($i in $hostname){
&”c:\psexec\psexec.exe” -s \\$i \\server\office12\setup.exe /adminfile cust_file.msp
}
Replace comp1…comp3 with the computer’s hostname or IP addresss.
Note: You can also pull the list of computers/IP addresses from a text file (one entry per line) by doing something like $hostname = Get-Content c:\computers.txt.
Step 6. Schedule the script in Task Scheduler
c:\windows\system32\WindowsPowerShell\v1.0\powershell.exe -noexit “c:\office_2007_install.ps1“
Some suggestions:
- Let your users know ahead of time when you are planning on upgrading their Office software. They may be working on a project and can’t afford to lose any time adjusting to the new version.
- Send these links (Interactive 2003 to 2007 Command Reference Guide) to your users before you upgrade their Office applications so there are no surprises when they first use Office 2007:
- Start with a small group of computers so if you discover a problem (eg. software conflict) there will be minimal interruption. For example, start with 5 computers and if there are no problems then increase it to 10 computers for the next batch, then 20, then 40, and so on.