I’ve updated a script that was intended for installing prerequisites for Exchange 2010 that were released by a couple of peoples (Anderson Patricio, Pat Richard and Bhargav Shukla). This script have now been updated and applies to Exchange 2013.
It will help you with installing all prerequisites (features) plus the FilterPack(s) and the Unified Communications Managed API. It also provides the option to disable the UAC (User Access Control) and the Windows Firewall.
Feel free to use it as much as you want, I just want to mention I do not provide support for it and there are no warranty.
The script/code can be viewed below:
############################################################################## Install-Exchange2013PreReqs.ps1# Configures the necessary prerequisites to install Exchange 2013 on a# Windows Server 2008 R2 server or Windows Server 2012 server## Updated by: Jonas Andersson# Original written by: Pat Richard, Anderson Patricio and Bhargav Shukla## Some info taken from# http://www.ucblogs.net/blogs/exchange/archive/2009/12/12/Automated-prerequisite-installation-via-PowerShell-for-Exchange-Server-2010-on-Windows-Server-2008-R2.aspx">http://www.ucblogs.net/blogs/exchange/archive/2009/12/12/Automated-prerequisite-installation-via-PowerShell-for-Exchange-Server-2010-on-Windows-Server-2008-R2.aspx# http://msmvps.com/blogs/andersonpatricio/archive/2009/11/13/installing-exchange-server-2010-pre-requisites-on-windows-server-2008-r2.aspx">http://msmvps.com/blogs/andersonpatricio/archive/2009/11/13/installing-exchange-server-2010-pre-requisites-on-windows-server-2008-r2.aspx# http://www.bhargavs.com/index.php/powershell/2009/11/script-to-install-exchange-2010-pre-requisites-for-windows-server-2008-r2/">http://www.bhargavs.com/index.php/powershell/2009/11/script-to-install-exchange-2010-pre-requisites-for-windows-server-2008-r2/############################################################################## Detect correct OS here and exit if no matchif(-not((Get-WMIObject win32_OperatingSystem).OSArchitecture-eq '64-bit')-and(((Get-WMIObject win32_OperatingSystem).Version-eq "6.1.7601")-or(Get-WMIObject win32_OperatingSystem).Version-eq "6.2.9200")){Write-Host"This script requires a 64bit version of Windows Server 2008 R2 or Windows Server 2012, which this is not."-ForegroundColorRed-BackgroundColorBlackExit}FunctionDisable-UAC(){
$path ="HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System"
$a =Get-ItemProperty $path -NameEnableLUAif($a |Select-String"0"){Write-Host"UAC is already disabled"-ForegroundColorGreenreturn}if($a |Select-String"1"){Write-Host"Enabled"-ForegroundColorRedSet-ItemProperty"HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System"-Name"EnableLUA"-Value0Write-host "Registry key HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA has been changed."-ForegroundColor yellow
Write-Host"UAC is now disabled"-ForegroundColorGreen}}FunctionDisable-FW(){
$status = netsh advfirewall show allprofiles state
if($status |Select-String"ON"){
$enabled = $true
}else{
$enabled = $false
}if($enabled -eq $true){
netsh advfirewall set allprofiles state off
Write-Host"Firewall is now disabled"-ForegroundColor yellow
return}if($enabled -eq $false){Write-Host"Firewall is already disabled"-ForegroundColorGreen}}FunctionInstallFilterPack(){if(Get-ItemProperty"HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\{95140000-2000-0409-1000-0000000FF1CE}"-ErrorActionSilentlyContinue){Write-host "FilterPack is already installed."-ForegroundColor yellow
return}else{
trap {Write-Host"Problem downloading FilterPackx64.exe. Please visit: <a href="http://www.microsoft.com/en-us/download/details.aspx?id=26604">http://www.microsoft.com/en-us/download/details.aspx?id=26604</a> and <a href="http://www.microsoft.com/en-us/download/details.aspx?id=17062"'>http://www.microsoft.com/en-us/download/details.aspx?id=17062"">http://www.microsoft.com/en-us/download/details.aspx?id=17062"</a>break}#set a var for the folder you are looking for
$folderPath ='C:\Temp'#Check if folder exists, if not, create itif(Test-Path $folderpath){Write-Host"The folder $folderPath exists."}else{Write-Host"The folder $folderPath does not exist, creating..."-NoNewlineNew-Item $folderpath -type directory |Out-NullWrite-Host"done!"-ForegroundColorGreen}# Check if file exists, if not, download it
$file1 = $folderPath+"\FilterPack64bit.exe"
$file2 = $folderPath+"\filterpack2010sp1-kb2460041-x64-fullfile-en-us.exe"if(Test-Path $file1){
write-host "The file $file1 exists."}else{#Download Microsoft Filter PackWrite-Host"Downloading Microsoft Filter Pack..."-nonewline
$clnt =New-ObjectSystem.Net.WebClient
$url ="<a href="http://download.microsoft.com/download/0/A/2/0A28BBFA-CBFA-4C03-A739-30CCA5E21659/FilterPack64bit.exe"'>http://download.microsoft.com/download/0/A/2/0A28BBFA-CBFA-4C03-A739-30CCA5E21659/FilterPack64bit.exe"">http://download.microsoft.com/download/0/A/2/0A28BBFA-CBFA-4C03-A739-30CCA5E21659/FilterPack64bit.exe"</a>
$clnt.DownloadFile($url,$file1)Write-Host"done!"-ForegroundColorGreen}if(Test-Path $file2){
write-host "The file $file2 exists."}else{#Download Microsoft Filter Pack SP1Write-Host"Downloading Microsoft Filter Pack SP1..."-nonewline
$clnt =New-ObjectSystem.Net.WebClient
$url ="<a href="http://download.microsoft.com/download/A/A/3/AA345161-18B8-45AE-8DC8-DA6387264CB9/filterpack2010sp1-kb2460041-x64-fullfile-en-us.exe"'>http://download.microsoft.com/download/A/A/3/AA345161-18B8-45AE-8DC8-DA6387264CB9/filterpack2010sp1-kb2460041-x64-fullfile-en-us.exe"">http://download.microsoft.com/download/A/A/3/AA345161-18B8-45AE-8DC8-DA6387264CB9/filterpack2010sp1-kb2460041-x64-fullfile-en-us.exe"</a>
$clnt.DownloadFile($url,$file2)Write-Host"done!"-ForegroundColorGreen}#Install Microsoft Filter PacksWrite-Host"Installing Microsoft Filter Packs..."
$args ="/quiet /norestart"
$setup1 =(Start-Process $file1 -ArgumentList $args -Wait-PassThru).ExitCodeif($setup1 -eq 0){ write-host "Successfully installed $file1"-ForegroundColorGreen}if($setup1 -ne 0){ write-host "Failed!"-ForegroundColorRed}
$setup2 =(Start-Process $file2 -ArgumentList $args -Wait-PassThru).ExitCodeif($setup2 -eq 0){ write-host "Successfully installed $file2"-ForegroundColorGreen}if($setup2 -ne 0){ write-host "Failed!"-ForegroundColorRed}}}FunctionInstallUMAPI(){#Change reg key below!if(Get-ItemProperty"HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\UCMA4"-ErrorActionSilentlyContinue){Write-host "Unified Communications Managed API 4.0 Runtime is already installed."-ForegroundColor yellow
return}else{
trap {Write-Host"Problem downloading UM API. Please visit: <a href="http://www.microsoft.com/en-us/download/details.aspx?id=34992"'>http://www.microsoft.com/en-us/download/details.aspx?id=34992"">http://www.microsoft.com/en-us/download/details.aspx?id=34992"</a>break}#set a var for the folder you are looking for
$folderPath ='C:\Temp'#Check if folder exists, if not, create itif(Test-Path $folderpath){Write-Host"The folder $folderPath exists."}else{Write-Host"The folder $folderPath does not exist, creating..."-NoNewlineNew-Item $folderpath -type directory |Out-NullWrite-Host"done!"-ForegroundColorGreen}# Check if file exists, if not, download it
$file = $folderPath+"\UcmaRuntimeSetup.exe"if(Test-Path $file){
write-host "The file $file exists."}else{#Download Microsoft UM APIWrite-Host"Downloading Microsoft UM API..."-nonewline
$clnt =New-ObjectSystem.Net.WebClient
$url ="<a href="http://download.microsoft.com/download/2/C/4/2C47A5C1-A1F3-4843-B9FE-84C0032C61EC/UcmaRuntimeSetup.exe"'>http://download.microsoft.com/download/2/C/4/2C47A5C1-A1F3-4843-B9FE-84C0032C61EC/UcmaRuntimeSetup.exe"">http://download.microsoft.com/download/2/C/4/2C47A5C1-A1F3-4843-B9FE-84C0032C61EC/UcmaRuntimeSetup.exe"</a>
$clnt.DownloadFile($url,$file)Write-Host"done!"-ForegroundColorGreen}#Check/Install Media Foundation feature
$mf =Get-WindowsFeature"Server-Media-Foundation"|select*Start-Sleep2if($mf.Installed-eq $False){Write-Host"Installing Media Foundation feature..."-ForegroundColorGreenAdd-WindowsfeatureServer-Media-FoundationWrite-Host""Write-Host"Installing of Media Foundation feature completed."-ForegroundColorGreenWrite-Host""Write-Host"Restart the server and restart the task"-ForegroundColorRedWrite-Host"or else the UM API won't be installed"-ForegroundColorRedWrite-Host""return}if($mf.Installed-eq $True){#Install Microsoft UM APIWrite-Host"Installing Microsoft UM API..."-ForegroundColorGreen
$args ="/quiet /norestart"
$setup =(Start-Process $file -ArgumentList $args -Wait-PassThru).ExitCodeif($setup -eq 0){ write-host "Successfully installed $file"-ForegroundColorGreen}if($setup -ne 0){ write-host "Failed!"-ForegroundColorRed}}}}Import-ModuleServerManager
$opt ="None"# Do {
clear
if($opt -ne "None"){write-host "Last command: "$opt -foregroundcolor Yellow}
write-host
write-host ExchangeServer2013-Prerequisites script
write-host Please,select which role you are going to install..
write-host
write-host '1) Client Access Server'
write-host '2) Mailbox'
write-host '3) Typical (CAS/Mailbox)'
write-host
write-host '10) Install Microsoft Filter Pack 2.0'
write-host ' Required if installing Mailbox Server roles'-foregroundcolor yellow
write-host ' Automatically set for options 2 and 3'-foregroundcolor yellow
write-host '11) Install Microsoft UM API'
write-host ' Required if installing Mailbox Server roles'-foregroundcolor yellow
Write-Host'12) Disable UAC'Write-Host'13) Disable Firewall'
write-host
write-host '15) Restart the Server'
write-host '16) End'
write-host
$opt =Read-Host"Select an option.. [1-14]? "switch($opt){1{# Windows Server 2008 R2 SP1if((Get-WMIObject win32_OperatingSystem).Version-eq "6.1.7601"){Import-ModuleServerManagerAdd-WindowsFeature"Desktop-Experience","NET-Framework","NET-HTTP-Activation","RPC-over-HTTP-proxy","RSAT-Clustering","RSAT-Web-Server","WAS-Process-Model","Web-Asp-Net","Web-Basic-Auth","Web-Client-Auth","Web-Digest-Auth","Web-Dir-Browsing","Web-Dyn-Compression","Web-Http-Errors","Web-Http-Logging","Web-Http-Redirect","Web-Http-Tracing","Web-ISAPI-Ext","Web-ISAPI-Filter","Web-Lgcy-Mgmt-Console","Web-Metabase","Web-Mgmt-Console","Web-Mgmt-Service","Web-Net-Ext","Web-Request-Monitor","Web-Server","Web-Stat-Compression","Web-Static-Content","Web-Windows-Auth","Web-WMI"-restart
}# Windows Server 2012if((Get-WMIObject win32_OperatingSystem).Version-eq "6.2.9200"){Install-WindowsFeature"AS-HTTP-Activation","Desktop-Experience","NET-Framework-45-Features","RPC-over-HTTP-proxy","RSAT-Clustering","RSAT-Clustering-CmdInterface","RSAT-Clustering-Mgmt","RSAT-Clustering-PowerShell","Web-Mgmt-Console","WAS-Process-Model","Web-Asp-Net45","Web-Basic-Auth","Web-Client-Auth","Web-Digest-Auth","Web-Dir-Browsing","Web-Dyn-Compression","Web-Http-Errors","Web-Http-Logging","Web-Http-Redirect","Web-Http-Tracing","Web-ISAPI-Ext","Web-ISAPI-Filter","Web-Lgcy-Mgmt-Console","Web-Metabase","Web-Mgmt-Console","Web-Mgmt-Service","Web-Net-Ext45","Web-Request-Monitor","Web-Server","Web-Stat-Compression","Web-Static-Content","Web-Windows-Auth","Web-WMI","Windows-Identity-Foundation"-restart
}}2{# Windows Server 2008 R2 SP1if((Get-WMIObject win32_OperatingSystem).Version-eq "6.1.7601"){Import-ModuleServerManagerInstallFilterPackAdd-WindowsFeature"Desktop-Experience","NET-Framework","NET-HTTP-Activation","RPC-over-HTTP-proxy","RSAT-Clustering","RSAT-Web-Server","WAS-Process-Model","Web-Asp-Net","Web-Basic-Auth","Web-Client-Auth","Web-Digest-Auth","Web-Dir-Browsing","Web-Dyn-Compression","Web-Http-Errors","Web-Http-Logging","Web-Http-Redirect","Web-Http-Tracing","Web-ISAPI-Ext","Web-ISAPI-Filter","Web-Lgcy-Mgmt-Console","Web-Metabase","Web-Mgmt-Console","Web-Mgmt-Service","Web-Net-Ext","Web-Request-Monitor","Web-Server","Web-Stat-Compression","Web-Static-Content","Web-Windows-Auth","Web-WMI"-restart
}# Windows Server 2012if((Get-WMIObject win32_OperatingSystem).Version-eq "6.2.9200"){InstallFilterPackInstall-WindowsFeature"AS-HTTP-Activation","Desktop-Experience","NET-Framework-45-Features","RPC-over-HTTP-proxy","RSAT-Clustering","RSAT-Clustering-CmdInterface","RSAT-Clustering-Mgmt","RSAT-Clustering-PowerShell","Web-Mgmt-Console","WAS-Process-Model","Web-Asp-Net45","Web-Basic-Auth","Web-Client-Auth","Web-Digest-Auth","Web-Dir-Browsing","Web-Dyn-Compression","Web-Http-Errors","Web-Http-Logging","Web-Http-Redirect","Web-Http-Tracing","Web-ISAPI-Ext","Web-ISAPI-Filter","Web-Lgcy-Mgmt-Console","Web-Metabase","Web-Mgmt-Console","Web-Mgmt-Service","Web-Net-Ext45","Web-Request-Monitor","Web-Server","Web-Stat-Compression","Web-Static-Content","Web-Windows-Auth","Web-WMI","Windows-Identity-Foundation"-restart
}}3{if((Get-WMIObject win32_OperatingSystem).Version-eq "6.1.7601"){Import-ModuleServerManagerInstallFilterPackAdd-WindowsFeature"Desktop-Experience","NET-Framework","NET-HTTP-Activation","RPC-over-HTTP-proxy","RSAT-Clustering","RSAT-Web-Server","WAS-Process-Model","Web-Asp-Net","Web-Basic-Auth","Web-Client-Auth","Web-Digest-Auth","Web-Dir-Browsing","Web-Dyn-Compression","Web-Http-Errors","Web-Http-Logging","Web-Http-Redirect","Web-Http-Tracing","Web-ISAPI-Ext","Web-ISAPI-Filter","Web-Lgcy-Mgmt-Console","Web-Metabase","Web-Mgmt-Console","Web-Mgmt-Service","Web-Net-Ext","Web-Request-Monitor","Web-Server","Web-Stat-Compression","Web-Static-Content","Web-Windows-Auth","Web-WMI"-restart
}# Windows Server 2012if((Get-WMIObject win32_OperatingSystem).Version-eq "6.2.9200"){InstallFilterPackInstall-WindowsFeature"AS-HTTP-Activation","Desktop-Experience","NET-Framework-45-Features","RPC-over-HTTP-proxy","RSAT-Clustering","RSAT-Clustering-CmdInterface","RSAT-Clustering-Mgmt","RSAT-Clustering-PowerShell","Web-Mgmt-Console","WAS-Process-Model","Web-Asp-Net45","Web-Basic-Auth","Web-Client-Auth","Web-Digest-Auth","Web-Dir-Browsing","Web-Dyn-Compression","Web-Http-Errors","Web-Http-Logging","Web-Http-Redirect","Web-Http-Tracing","Web-ISAPI-Ext","Web-ISAPI-Filter","Web-Lgcy-Mgmt-Console","Web-Metabase","Web-Mgmt-Console","Web-Mgmt-Service","Web-Net-Ext45","Web-Request-Monitor","Web-Server","Web-Stat-Compression","Web-Static-Content","Web-Windows-Auth","Web-WMI","Windows-Identity-Foundation"-restart
}}10{# future - auto detect Internet access
write-host 'Can this server access the Internet?'
$filtpack = read-host 'Please type (Y)es or (N)o...'switch($filtpack){
Y {InstallFilterPack}
N {Write-warning 'Please download and install Microsoft Filter Pack from here: <a href="http://www.microsoft.com/en-us/download/details.aspx?id=26604">http://www.microsoft.com/en-us/download/details.aspx?id=26604</a> and <a href="http://www.microsoft.com/en-us/download/details.aspx?id=17062'}">http://www.microsoft.com/en-us/download/details.aspx?id=17062'}</a>
}
}
11 {
# future - auto detect Internet access
write-host 'Can this server access the Internet?'
$umapi = read-host 'Please type (Y)es or (N)o...'
switch ($umapi) {
Y { InstallUMAPI }
N {Write-warning 'Please download and install Microsoft UM API from here: <a href="http://www.microsoft.com/en-us/download/details.aspx?id=34992'}">http://www.microsoft.com/en-us/download/details.aspx?id=34992'}</a>}}12{Disable-UAC }13{Disable-FW }15{Restart-Computer}16{Write-Host"Exiting..."Exit}default{write-host "You haven't selected any of the available options. "}}
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.
I’ve updated a script that was intended for installing prerequisites for Exchange 2010 that were released by a couple of peoples (Anderson Patricio, Pat Richard and Bhargav Shukla). This script have now been updated and applies to Exchange 2013.
It will help you with installing all prerequisites (features) plus the FilterPack(s) and the Unified Communications Managed API. It also provides the option to disable the UAC (User Access Control) and the Windows Firewall.
You can download the script here
Feel free to use it as much as you want, I just want to mention I do not provide support for it and there are no warranty.
The script/code can be viewed below:
Share this post
Link to post
Share on other sites