Applies to: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1
Topic Last Modified: 2009-04-06

This topic provides sample batch files that can be used as a starting point for creating the batch files required to make a build DVD to improve the server build process. You can modify the following procedures to create the necessary batch files for your organization.

The following sample scripts must be modified as described in the script remarks in order to make them functional in your specific environment. This script will help you automate many of the steps required to deploy an Exchange server in your environment.

Sample Batch Files

Important:
These scripts are samples to illustrate how automation steps can be implemented. You must modify them to make them appropriate for your environment. You must test everything in a lab environment prior to attempting to use them in your production environment.
Important:
Where a batch file calls for the installation of a file, you will need to ensure that the file has been downloaded and placed in the appropriate installation directory. For more information, see How to Create a Configuration DVD and Automation Files.

Before You Begin

To perform the following procedures, the account you use must be a member of the Local Administrators group.

For more information about permissions, delegating roles, and the rights that are required to administer Exchange 2007, see Permission Considerations.

E2K7-PreReqs.bat

Before attempting to prepare the Exchange Server 2007 prerequisites batch file, you should be fully familiar with the topic Exchange 2007 System Requirements.

Note:
This batch file is only required for Windows Server 2003.

Procedure

Use Notepad to create a batch file to automate the installation of Exchange 2007 prerequisites in your Exchange environment

  1. Open Notepad or another text editor.

  2. Copy the following code into a file and save the file with a descriptive name and the .bat extension. We recommend naming the file e2k7-prereqs.bat.

    Copy Code
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #"!!!!!!!  THIS IS NOT A MICROSOFT SUPPORTED SCRIPT.  !!!!!!!!"
    #"!!!!!!!	TEST IN A LAB FOR DESIRED OUTCOME	!!!!!!!!"
    #"!!!!!!!						!!!!!!!!!!"
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #" "
    
    @echo off
    echo.  This batch file will install Exchange 2007 pre-requisites.
    echo.  Press a button to continue.
    pause
    
    WindowsServer2003-KB904639-x64-ENU.exe -z -m
    WindowsServer2003.WindowsXP-KB907265-x64-ENU.exe -z -m
    WindowsServer2003.WindowsXP-KB918980-x64-ENU.exe -z -m
    WindowsServer2003.WindowsXP-KB921181-v5-x64-ENU.exe -z -m
    NDP20-KB926776-x64.exe -z -m
    WindowsServer2003.WindowsXP-KB926139-x64-ENU.exe -z -m
    
    cls
    echo.  PLEASE REBOOT NOW!!!
    Pause
    

E2K7-PostSP1.bat

Procedure

Use Notepad to create a batch file to automate the installation of Exchange 2007 post SP1 hotfixes in your Exchange environment

  1. Open Notepad or another text editor.

  2. Copy the following code into a file and save the file with a descriptive name and the .bat extension. We recommend naming the file e2k7-postsp1.bat.

    Copy Code
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #"!!!!!!!  THIS IS NOT A MICROSOFT SUPPORTED SCRIPT.  !!!!!!!!"
    #"!!!!!!!	TEST IN A LAB FOR DESIRED OUTCOME	!!!!!!!!"
    #"!!!!!!!						!!!!!!!!!!"
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #" "
    @echo off
    
    REM here is an example of how to do this.
    
    REM 1-Exchange2003-KB839913-x86-enu.exe -z -m
    REM 2-Exchange2003-KB883419-x86-ENU.exe -z -m
    
    cls
    echo.  Exchange 2007 Post-RTM Hot-Fixes Installation Completed!!!
    pause
    

Edge-PreReqs.bat

Procedure

Use Notepad to create a batch file to automate the installation of Exchange 2007 Edge Transport server role prerequisites in your Exchange environment

  1. Open Notepad or another text editor.

  2. Copy the following code into a file and save the file with a descriptive name and the .bat extension. We recommend naming the file edge-prereqs.bat.

    Copy Code
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #"!!!!!!!  THIS IS NOT A MICROSOFT SUPPORTED SCRIPT.  !!!!!!!!"
    #"!!!!!!!	TEST IN A LAB FOR DESIRED OUTCOME	!!!!!!!!"
    #"!!!!!!!						!!!!!!!!!!"
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #" "
    
    @echo off
    echo.  This batch file will install Exchange 2007 pre-requisites.
    echo.  Press a button to continue.
    pause
    
    WindowsServer2003-KB904639-x64-ENU.exe -z -m
    WindowsServer2003.WindowsXP-KB907265-x64-ENU.exe -z -m
    WindowsServer2003.WindowsXP-KB918980-x64-ENU.exe -z -m
    WindowsServer2003.WindowsXP-KB921181-v5-x64-ENU.exe -z -m
    NDP20-KB926776-x64.exe -z -m
    WindowsServer2003.WindowsXP-KB926139-x64-ENU.exe -z -m
    ADAMSP1_x64_English.exe -z -m
    
    cls
    echo.  PLEASE REBOOT NOW!!!
    Pause
    

UM-PreReqs.bat

Procedure

Use Notepad to create a batch file to automate the installation of Exchange 2007 Unified Messaging server role prerequisites in your Exchange environment

  1. Open Notepad or another text editor.

  2. Copy the following code into a file and save the file with a descriptive name and the .bat extension. We recommend naming the file um-prereqs.bat.

    Copy Code
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #"!!!!!!!  THIS IS NOT A MICROSOFT SUPPORTED SCRIPT.  !!!!!!!!"
    #"!!!!!!!	TEST IN A LAB FOR DESIRED OUTCOME	!!!!!!!!"
    #"!!!!!!!						!!!!!!!!!!"
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #" "
    @echo off
    echo.  This batch file will install Exchange 2007 pre-requisites.
    echo.  Press a button to continue.
    pause
    
    msxml6_x64.msi
    pause
    WMEncoder64.exe
    pause
    WindowsMedia10-KB917312-x64-INTL.exe -z -m
    
    cls
    echo.  PLEASE REBOOT NOW!!!
    pause
    

IE7-install.bat

Note:
This batch file is only required for Windows Server 2003.

Procedure

Use Notepad to create a batch file to automate the installation of Internet Explorer 7 on Exchange 2007 servers in your Exchange environment

  1. Open Notepad or another text editor.

  2. Copy the following code into a file and save the file with a descriptive name and the .bat extension. We recommend naming the file ie7-install.bat.

    Copy Code
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #"!!!!!!!  THIS IS NOT A MICROSOFT SUPPORTED SCRIPT.  !!!!!!!!"
    #"!!!!!!!	TEST IN A LAB FOR DESIRED OUTCOME	!!!!!!!!"
    #"!!!!!!!						!!!!!!!!!!"
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #" "
    @echo off
    echo.  This batch file will install Internet Explorer 7 x64.
    echo.  Press a button to continue.
    pause
    
    IE7-WindowsServer2003-x64-enu.exe -z -m
    
    cls
    echo.  PLEASE REBOOT NOW!!!
    pause
    

E2K7-post-sp2.bat

Procedure

Use Notepad to create a batch file to automate the installation of Exchange 2007 post-SP2 hotfixes in your Exchange environment

  1. Open Notepad or another text editor.

  2. Copy the following code into a file and save the file with a descriptive name and the .bat extension. We recommend naming the file post-e2k7sp2.bat.

    Copy Code
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #"!!!!!!!  THIS IS NOT A MICROSOFT SUPPORTED SCRIPT.  !!!!!!!!"
    #"!!!!!!!	TEST IN A LAB FOR DESIRED OUTCOME	!!!!!!!!"
    #"!!!!!!!						!!!!!!!!!!"
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #" "
    @echo off
    echo.  This batch file should only be run on Windows Server 2003 (Exchange 2007) / IIS servers!
    echo.  Press a button to continue.
    pause
    
    REM here is an example of how to do this.
    
    REM WindowsServer2003-KB896428-x86-enu.exe -z -m
    REM WindowsServer2003-KB890046-x86-enu.exe -z -m
    
    cls
    echo.  PLEASE REBOOT NOW!!!
    Pause
    

W2K3-post-sp2.bat

Note:
This batch file is only required for Windows Server 2003.

Procedure

Use Notepad to create a batch file to automate the installation of Windows Server 2003 post-SP2 hotfixes in your Exchange environment

  1. Open Notepad or another text editor.

  2. Copy the following code into a file and save the file with a descriptive name and the .bat extension. We recommend naming the file w2k3-post-sp2.bat.

    Copy Code
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #"!!!!!!!  THIS IS NOT A MICROSOFT SUPPORTED SCRIPT.  !!!!!!!!"
    #"!!!!!!!	TEST IN A LAB FOR DESIRED OUTCOME	!!!!!!!!"
    #"!!!!!!!						!!!!!!!!!!"
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #" "
    @echo off
    echo.  This batch file should only be run on Windows Server 2003 without IIS!  
    echo.  Press a button to continue.
    pause
    
    REM here is an example of how to do this.
    
    REM WindowsServer2003-KB896428-x86-enu.exe -z -m
    REM WindowsServer2003-KB890046-x86-enu.exe -z -m
    
    cls
    echo.  PLEASE REBOOT NOW!!!
    pause
    

W2K8-hotfix.bat

Note:
This batch file is only required for Windows Server 2008.

Procedure

Use Notepad to create a batch file to automate the installation of Windows Server 2008 hotfixes in your Exchange environment

  1. Open Notepad or another text editor.

  2. Copy the following code into a file and save the file with a descriptive name and the .bat extension. We recommend naming the file w2k8-hotfix.bat.

    Copy Code
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #"!!!!!!!  THIS IS NOT A MICROSOFT SUPPORTED SCRIPT.  !!!!!!!!"
    #"!!!!!!!	TEST IN A LAB FOR DESIRED OUTCOME	!!!!!!!!"
    #"!!!!!!!						!!!!!!!!!!"
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #" "
    @echo off
    echo.  This batch file should only be run on Windows Server 2008!  
    echo.  Press a button to continue.
    pause
    
    REM here is an example of how to do this.
    
    REM wusa.exe Windows6.0-KB951116-x64.msu /quiet /norestart
    REM  wusa.exe Windows6.0-KB948572-x64.msu /quiet /norestart
    
    cls
    echo.  PLEASE REBOOT NOW!!!
    pause
    

W2K8-Clus-hotfix.bat

Note:
This batch file is only required for Windows Server 2008.

Procedure

Use Notepad to create a batch file to automate the installation of Windows Server 2008 hotfixes in your Exchange environment

  1. Open Notepad or another text editor.

  2. Copy the following code into a file and save the file with a descriptive name and the .bat extension. We recommend naming the file w2k8-clus-hotfix.bat.

    Copy Code
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #"!!!!!!!  THIS IS NOT A MICROSOFT SUPPORTED SCRIPT.  !!!!!!!!"
    #"!!!!!!!	TEST IN A LAB FOR DESIRED OUTCOME	!!!!!!!!"
    #"!!!!!!!						!!!!!!!!!!"
    #"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
    #" "
    @echo off
    echo.  This batch file should only be run on Windows Server 2008 Failover Clusters!  
    echo.  Press a button to continue.
    pause
    
    REM here is an example of how to do this.
    
    REM wusa.exe Windows6.0-KB948720-x64.msu /quiet /norestart
    REM wusa.exe Windows6.0-KB950181-x64.msu /quiet /norestart
    
    cls
    echo.  PLEASE REBOOT NOW!!!
    pause
    

For More Information

For more information about creating a configuration DVD or server installation automation files, see How to Create a Configuration DVD and Automation Files.