If you are performing mass deployment of Exchange servers in a large environment, automating the installation process can minimize administrator error and speed up the overall process. The setup.exe
utility can be used to perform an unattended installation of Exchange, and when combined with PowerShell and just a little bit of scripting logic, it can create a fairly sophisticated installation script. This recipe will provide a couple of examples that can be used to script the installation of an Exchange server.
You can use a standard PowerShell console from the server to run the scripts in this recipe.
Let's see how to create an automated installation script that installs Exchange based on the hostname of the server:
Using Notepad or your favorite scripting editor, add the following code to a new file:
Param($Path) if(Test-Path $Path) { switch -wildcard ($env:computername) { "*-EX-*" {$role = "CA,MB" ; break} "*...