Exchange Server 2013

Exchange 2013 script – automatic installation of prerequisites

Exchange 2013 script – automatic installation of prerequisites

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:

#############################################################################
 # 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 match
 if (-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." -ForegroundColor Red -BackgroundColor Black
 Exit
 }

Function Disable-UAC(){

$path = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System"
 $a = Get-ItemProperty $path -Name EnableLUA

if ($a | Select-String "0")
 {
 Write-Host "UAC is already disabled" -ForegroundColor Green
 return
 }

if ($a | Select-String "1")
 {
 Write-Host "Enabled" -ForegroundColor Red
 Set-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLUA" -Value 0
 Write-host "Registry key HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA has been changed." -ForegroundColor yellow
 Write-Host "UAC is now disabled" -ForegroundColor Green
 }

}

Function Disable-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" -ForegroundColor Green
 }

}

Function InstallFilterPack(){

if (Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\{95140000-2000-0409-1000-0000000FF1CE}" -ErrorAction SilentlyContinue) {

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&quot;">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 it
 if (Test-Path $folderpath){
 Write-Host "The folder $folderPath exists."
 } else{
 Write-Host "The folder $folderPath does not exist, creating..." -NoNewline
 New-Item $folderpath -type directory | Out-Null
 Write-Host "done!" -ForegroundColor Green
 }

# 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 Pack
 Write-Host "Downloading Microsoft Filter Pack..." -nonewline
 $clnt = New-Object System.Net.WebClient
 $url = "<a href="http://download.microsoft.com/download/0/A/2/0A28BBFA-CBFA-4C03-A739-30CCA5E21659/FilterPack64bit.exe&quot;">http://download.microsoft.com/download/0/A/2/0A28BBFA-CBFA-4C03-A739-30CCA5E21659/FilterPack64bit.exe"</a>
 $clnt.DownloadFile($url,$file1)
 Write-Host "done!" -ForegroundColor Green
 }

if (Test-Path $file2){
 write-host "The file $file2 exists."
 } else {
 #Download Microsoft Filter Pack SP1
 Write-Host "Downloading Microsoft Filter Pack SP1..." -nonewline
 $clnt = New-Object System.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&quot;">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!" -ForegroundColor Green
 }

#Install Microsoft Filter Packs
 Write-Host "Installing Microsoft Filter Packs..."

$args = "/quiet /norestart"
 $setup1 = (Start-Process $file1 -ArgumentList $args -Wait -PassThru).ExitCode
 if ($setup1 -eq 0) { write-host "Successfully installed $file1" -ForegroundColor Green }
 if ($setup1 -ne 0) { write-host "Failed!" -ForegroundColor Red }

$setup2 = (Start-Process $file2 -ArgumentList $args -Wait -PassThru).ExitCode
 if ($setup2 -eq 0) { write-host "Successfully installed $file2" -ForegroundColor Green }
 if ($setup2 -ne 0) { write-host "Failed!" -ForegroundColor Red }

}
 }

Function InstallUMAPI(){

#Change reg key below!
 if (Get-ItemProperty "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\UCMA4" -ErrorAction SilentlyContinue) {

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&quot;">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 it
 if (Test-Path $folderpath){
 Write-Host "The folder $folderPath exists."
 } else{
 Write-Host "The folder $folderPath does not exist, creating..." -NoNewline
 New-Item $folderpath -type directory | Out-Null
 Write-Host "done!" -ForegroundColor Green
 }

# 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 API
 Write-Host "Downloading Microsoft UM API..." -nonewline
 $clnt = New-Object System.Net.WebClient
 $url = "<a href="http://download.microsoft.com/download/2/C/4/2C47A5C1-A1F3-4843-B9FE-84C0032C61EC/UcmaRuntimeSetup.exe&quot;">http://download.microsoft.com/download/2/C/4/2C47A5C1-A1F3-4843-B9FE-84C0032C61EC/UcmaRuntimeSetup.exe"</a>
 $clnt.DownloadFile($url,$file)
 Write-Host "done!" -ForegroundColor Green
 }

#Check/Install Media Foundation feature
 $mf = Get-WindowsFeature "Server-Media-Foundation" | select *

Start-Sleep 2

if ($mf.Installed -eq $False)
 {
 Write-Host "Installing Media Foundation feature..."    -ForegroundColor Green
 Add-Windowsfeature Server-Media-Foundation

Write-Host ""
 Write-Host "Installing of Media Foundation feature completed." -ForegroundColor Green
 Write-Host ""
 Write-Host "Restart the server and restart the task" -ForegroundColor Red
 Write-Host "or else the UM API won't be installed" -ForegroundColor Red
 Write-Host ""

return

}

if ($mf.Installed -eq $True)
 {
 #Install Microsoft UM API
 Write-Host "Installing Microsoft UM API..." -ForegroundColor Green

$args = "/quiet /norestart"
 $setup = (Start-Process $file -ArgumentList $args -Wait -PassThru).ExitCode
 if ($setup -eq 0) { write-host "Successfully installed $file" -ForegroundColor Green }
 if ($setup -ne 0) { write-host "Failed!" -ForegroundColor Red }

}
 }

}

Import-Module ServerManager
 $opt = "None"
 # Do {
 clear
 if ($opt -ne "None") {write-host "Last command: "$opt -foregroundcolor Yellow}
 write-host
 write-host Exchange Server 2013 - 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 SP1
 if ((Get-WMIObject win32_OperatingSystem).Version -eq "6.1.7601") {

Import-Module ServerManager
 Add-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 2012
 if ((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 SP1
 if ((Get-WMIObject win32_OperatingSystem).Version -eq "6.1.7601") {

Import-Module ServerManager
 InstallFilterPack
 Add-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 2012
 if ((Get-WMIObject win32_OperatingSystem).Version -eq "6.2.9200") {

InstallFilterPack
 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

}

}

3 {

if ((Get-WMIObject win32_OperatingSystem).Version -eq "6.1.7601") {

Import-Module ServerManager
 InstallFilterPack
 Add-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 2012
 if ((Get-WMIObject win32_OperatingSystem).Version -eq "6.2.9200") {

InstallFilterPack
 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

}

}
 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. "}
 }
Author of a book – PowerShell cookbook

Author of a book – PowerShell cookbook

If you have missed the news on my twitter, I can tell you that the last 6 months I’ve been busy with writing a book called “Microsoft Exchange 2013 PowerShell Cookbook: second edition” for Packt Publishing.

That’s also why the blog not have been updated that much lately, now it’s time to startup with the activities for the online community work again since the book more or less is completed. Just doing the final updates of the chapters. I want to thank both Anderson Patricio [MVP] and Marcelo Vighi [MVP] for doing a great job with the review.
I also want to send a special thank you to Magnus Björk [MVP] for helping me out when bugs were found.

It have been a great experience doing this project, both exciting and exhausting in the same time because of high tempo and tight time schedules. But I can recommend everyone that thinking of doing this kind of job, DO IT!

You might wonder when it will be released? mid June..

9427EN_MockupCover_Cookbook

More info about the book can be found here:
http://www.packtpub.com/microsoft-exchange-server-2013-powershell-2e-cookbook/book
http://www.amazon.com/Microsoft-Exchange-PowerShell-Cookbook-ebook/dp/B00BP47WHE/ref=sr_1_1?s=digital-text&ie=UTF8&qid=1364252267&sr=1-1

And some information about me:
http://www.packtpub.com/authors/profiles/jonas-andersson

Exchange Server 2013 Preview – Part 3: How to configure site URL’s, Databases and Outlook Anywhere

Exchange Server 2013 Preview – Part 3: How to configure site URL’s, Databases and Outlook Anywhere

I suppose you already have, but if you haven’t read my previous parts in this Exchange 2013 serie, have a look at the links below.

Part 1: Complete guide of how to perform the installation
Part 2: How to do the Basic configuration

This part will include details on how the configuration could be made for Site URL’s/Virtual Directories, Databases, Outlook Anywhere and MAPI vs RPC over HTTPs together with connecting using Outlook 2013.

In the previous part we did install the certificate which included the following names, so we can use these names in the site configuration. (If using HTTPS, the configured name needs to be included into the certificate.)

  • mail.testlabs.se
  • autodiscover.testlabs.se
  • tlcas01
  • tlcas01.testlabs.se
Sites / URL’s

Let’s go through the steps for configuring the sites with the ExternalURL and other settings.
I’ll go through both the EAC and the PowerShell, so you have the opportunity to select which method you prefer.

Let’s start..

In EAC: Go to Servers, select Virtual Directories.

image

Select the server in the menu and which type you want to show. Then press Edit.

image

Let’s start with Autodiscover.

image

By default, Integrated Windows Authentication and Basic authentication is enabled. Press Save.

image

Next, select Exchange ActiveSync (EAS). Press Edit.

image

General settings shows the URL’s, I did type in the ExternalURL like the pic below. Press Authentication.

image

Make sure that Basic authentication is enabled. Press Save.

image

Next, select ECP. Press Edit.

image

General settings shows the URL’s, I did type in the ExternalURL like the pic below. Press Authentication.

image

Authentication default settings is “Use forms-based authentication” enabled. Press Save.

image

A warning, make sure to change all virtual directions. Press OK.

image

Next, select EWS. Press Edit.

image

General settings shows the URL’s, I did type in the ExternalURL like the pic below. Press Authentication.

image

Authentication settings, Integrated Windows authentication is enabled by default. Press Save.

image

Next, select OAB. Press Edit.

image

I did type in the ExternalURL in this setting, the InternalURL was already configured. I did also change the Polling interval from 480 minutes to 60. For having a faster update of the OAB. Press Save.

image

Next, select OWA. Press Edit.

image

General settings shows the URL’s, I did type in the ExternalURL like the pic below. Press Authentication.

image

Forms-based authentication is selected, I did select the Logon format: User name only and did select my domain by the browsing button. Press Features.

image

Showing the default settings. Press File Access.

image

Showing the default settings. Press Save.

image

Next, select PowerShell. Press Edit.

image

General settings shows the URL’s, I did type in the ExternalURL like the pic below. Press Authentication.

image

Both Integrated Windows authentication and Basic authentication was selected by default. Press Save.

image

Using PowerShell

Start the Exchange Management Shell (EMS) and the following commands will do the same work that’s done in EAC.

Autodiscover:
Get-ClientAccessServer | fl *uri*
Set-ClientAccessServer –Identity TLCAS01 –AutoDiscoverServiceInternalUri https://autodiscover.testlabs.se/Autodiscover/autodiscover.xml

image

Exchange ActiveSync (EAS):
Get-ActiveSyncVirtualDirectory | fl *url*, ide*
Set-ActiveSyncVirtualDirectory –Identity “TLCAS01\Microsoft-Server-ActiveSync (Default Web Site)” –ExternalUrl https://mail.testlabs.se/Microsoft-Server-ActiveSync
image

Exchange Control Panel (ECP):
Get-EcpVirtualDirectory | fl *url*, ide*
Set-EcpVirtualDirectory –Identity “TLCAS01\ecp (Default Web Site)” –ExternalUrl https://mail.testlabs.se/ecp

image

Exchange Web Services (EWS):
Get-WebServicesVirtualDirectory | fl *url*, ide*
Set-WebServicesVirtualDirectory –Identity “TLCAS01\EWS (Default Web Site)” –ExternalUrl https://mail.testlabs.se/EWS/Exchange.asmx

image

Offline Address Book (OAB):
Get-OabVirtualDirectory | fl *url*, ide*,pol*
Set-OabVirtualDirectory –Identity “TLCAS01\OAB (Default Web Site)” –ExternalUrl https://mail.testlabs.se/OAB –PollInterval 60

image

Outlook Web App (OWA):
Get-OwaVirtualDirectory | fl *url*, ide*
Set-OwaVirtualDirectory –Identity “TLCAS01\OWA (Default Web Site)” –ExternalUrl https://mail.testlabs.se/OWA

image

PowerShell:
Get-PowerShellVirtualDirectory | fl *url*, ide*
Set-PowerShellVirtualDirectory –Identity “TLCAS01\PowerShell (Default Web Site)” –ExternalUrl https://mail.testlabs.se/powershell

image

Databases

Let’s go through the steps that’s required for renaming the default database, dismount and mount. Also creating new databases. Let’s start with the EAC and then do it in PowerShell.

Let’s start..

In EAC: Go to Servers, select Databases.

Select the default database, named “Mailbox Database 0883045..”. Press Edit.

image

General settings is shown. Press Cancel.

image

Select the database, Dismount it by pressing the … icon and press Dismount database.

image

It does show a warning, that mailboxes being on this database now will be unavailable. Press Yes.

image

Select the database. Press Edit.

image

Give the database a friendly name, example: DB01. Press Maintenance.

image

Maintenance settings is shown. Press Limits.

image

Mailbox limits are shown, these are the default values. Press Client Settings.

image

By default, no Offline address book was selected. Press Browse and make sure to select the address book. Press Save.

image

What about if you want to create a new database?

Let’s start in EAC

Press the Add button (+).

image

Give the database a friendly name, example: DB02. Browse for a mailbox server. And also put in the database path and log path. Press Save.

image

During the creating of the database, there is not option for associate the database with the offline address book. When the database is created, press Edit. Then go to Client Settings and select the Offline address book.

image

Using PowerShell

Start the Exchange Management Shell (EMS) and the following commands will do the same work that’s done in EAC.

Retrieve database information
Get-MailboxDatabase
Get-MailboxDatabase | fl name,*path*

Dismount Database
Dismount-Database –Identity DB01

After the default database is renamed to DB01, I want to move the database file and the logs to another drive. It’s done by the commands below:

Move-DatbasePath –identity DB01 –EdbFilePath “E:\Database\DB01\DB01.edb” –LogFolderPath “F:\Logs\DB01”

Mount-Database DB01

image

Get-OfflineAddressBook

For creating a new database (DB02), we have the opportunity in PowerShell to specify all parameters that’s needed for having all options configured.

New-MailboxDatabase -Name DB02 -EdbFilePath “E:\Database\DB02\DB02.edb” -LogFolderPath “F:\Logs
\DB02” -OfflineAddressBook “\Default Offline Address Book” -Server TLMB01

Mount-Database DB02

image

Note that the OfflineAddressBook is specified during the creation of the database.

Outlook Anywhere

Configuration of the feature Outlook Anywhere can also be done from both the EAC and EMS, in various ways.

Let’s start with the EAC:

Go to the servers menu, and select Servers. Press Edit.

image

Then go to the “Outlook Anywhere” option, type in the external name, example: mail.testlabs.se.
I’m using Basic authentication for Outlook Anywhere. Press Save.

image

And the Configuration is completed.

Using PowerShell

Start the Exchange Management Shell (EMS) and the following commands will do the same work that’s done in EAC.

Enable Outlook Anywhere:
Enable-OutlookAnywhere –Server TLCAS01 –ExternalHostname mail.testlabs.se –InternalHostname tlcas01.testlabs.se –ExternalClientAuthenticationMethod Basic –InternalClientAuthenticationMethod Ntlm –IISAuthentication Ntlm –SSLOffloading:$false

Get-OutlookAnywhere –Server TLCAS01

image

MAPI and RPC

The MAPI/RPC (RPC over TCP) traffic is now gone and  replaced with RPC over HTTP/s instead. With that said no more load balancing of static RPC ports, as far as I know this will make both the Firewall team and the Load Balancer teams work easier, less ports is used together with the requirement of load balancing affinity/sticky session settings is not required anymore. This because of there is no need anymore to have the affinity settings, it can now be load balanced based on IP addresses. Just make sure that the load balancer verifies the Exchange services before sending traffic to it.

Outlook instead will use port 443 (HTTPS) or port 80 (HTTP). I think (and hope) most of you will use RPC over HTTPS, with this said I’ll show you the new Outlook 2013 Preview/beta and how it connects and also the traffic it’s using.

Outlook 2013 Preview, connects to my mailbox in Exchange 2013. It’s using HTTPS to initiate the connection, using port 6001 by default for it’s connection, using RPC over HTTPS.

image

A small picture from Network Monitor when the connection initiated by Outlook 2013.

image

More information around What’s new in Exchange 2013 can be found here.

Next parts will cover Public Folders, Client Access Server Array, Database Availability Groups and more.
Next part can be found here.

Thanks for reading, I hope it helped you guys/girls out there.
If you want me to cover anything special around Exchange 2013, leave a comment.

Exchange Server 2013 Preview – Part 2: How to do the Basic configuration

Exchange Server 2013 Preview – Part 2: How to do the Basic configuration

If you haven’t read it already, I did post a complete guide for installing Exchange 2013, it can be found here. That was part 1, now it’s time for part 2. Which of course is the configuration of the server setup.

We have lots of changes between how you configured Exchange 2007/2010 and 2013.
First thing is that Exchange Management Console is gone and replaced by a refreshed ECP called Exchange Admin Center (EAC), built on Silverlight (I suppose). The “old” Exchange Management Shell (EMS) is still there, so I suppose lots of us geeks will use more PowerShell in the near future.

The fact that EMC is replaced will make the administration easier and more portable, but I still like the EMC better. I will like the EAC better after used it for a while. This portable administration together with Remote PowerShell will be awesome.

I will use both methods for the configuration steps, both EAC and PowerShell.

The easiest way to find the URL path to the EAC is to start the Exchange Management Shell and run the command below:

Get-EcpVirtualDirectory | fl *url*

The picture below is my output from my lab environment

image

So let’s get things started..

Start up an Internet browser and go to the URL output from the command above

image

Mail Flow

Let’s get the mail flow configured first so we can receive mails from external senders.

In EAC: on the left side (menu) press “Mail Flow”.

image

Accepted Domains

Ensure sure that your domains that should be used for SMTP is listed in here for making Exchange able to receive mails for these domains. More info about Accepted Domains can be found here.

In EAC: After selecting “Mail Flow” to the left, press “Accepted Domains” at the top menu in the middle.

image

If your domain is not listed and you need to add it, press the plus mark and fill in the information, like my example below.

image

image

Using PowerShell: Since I’m a geek I like to use PowerShell because it gives you the advantage of see what happens, have the full control and easily build scripts.

For listing and adding a domain like above in PowerShell you should write:

Get-AcceptedDomain
New-AcceptedDomain –Name testlabs.com –DomainName testlabs.com –DomainType Authoritative

image

Email Address Policies

These policies are used to stamp each user mailbox object with an email address/SMTP address.
These policies does not remove any addresses used previously, it just adds new addresses to mail objects.

In EAC: By default after the installation we only have one policy, called Default Policy.

I want to edit this one, by selecting the “Default Policy” and pressing the “pen” icon.

image

The Default Policy is showing up, in the left menu, press “Email Address Format”.

image

Since I live in Sweden and we have some special characters that I want to get rid of, I’m using the custom policy, Address type: SMTP and the Email address parameters:

%råa%räa%röo%g.%råa%räa%röo%s@testlabs.se

%r means it replaces the character after, in this case åäö. Which it replaces with aao.

When you have done the change press the “Save” button at the bottom of the page.

image

Check so that the change is correct, then press the “Save” button.

image

After the changes have been saved, it needs to be applied. This is done by pressing the “Apply” text/button down in the right menu.

image

image

Using PowerShell: Let’s start with listing the Policy and the settings in it. As a final step let’s do the same configuration to the “Default Policy” that we did using EAC.

If you want to create more than just alias@domain.com to your policies, then this is done by comma separation. For setting the Primary SMTP address, use capital letters for SMTP, and for additional addresses use small letters for smtp. See the example below:

Get-EmailAddressPolicy

Get-EmailAddressPolicy | fl

Get-EmailAddressPolicy | Set-EmailAddressPolicy –EnabledEmailAddressTemplates “SMTP: %råa%räa%röo%g.%råa%räa%röo%s@testlabs.se”,”smtp: %m@testlabs.se”

Set-EmailAddressPolicy –identity “Default Policy” –EnabledEmailAddressTemplates “SMTP: %råa%räa%röo%g.%råa%räa%röo%s@testlabs.se”,”smtp: %m@testlabs.se”

Get-EmailAddressPolicy | Update-EmailAddressPolicy

It can easily be checked if the policy has been applied, it will show a True or False value. For checking the value run the command below:

Get-EmailAddressPolicy | fl *appl*

Note: Don’t forget to update the Policy, or else the new addresses won’t be pushed out to the recipients.

image

Receive Connectors

Since the HUB Transport server role now is gone and the HUB role is placed together with the CAS role, this is the server you should be looking at.

After the SMTP domains have been added into the Accepted Domain tab, some settings could be of value to have a look at before starting to use the servers.

A change has been made to the new version, the default connector now named “Default Frontend servername”. It now allows traffic from Anonymous users by default. I suppose this is due to that the Edge Transport Role also is removed.

In EAC: Go to the “Receive Connectors”, found under “Mail Flow”. Make sure to select your CAS server(s) and the “Default Frontend servername”. Then press the “pen” icon for Edit the selected connector.

image

The only thing I did change was the “Maximum receive message size” to 30 MB.
When you have done your changes for the connector, press the Save button.

image

Using PowerShell: Start the Exchange Management Shell, lets view the receive connectors and then make the changes like above.

Get-ReceiveConnector

Get-ReceiveConnector | fl

Set-ReceiveConnector –Identity “TLCAS01\Default Frontend TLCAS01” –MaxMessageSize 30MB

Note: The size can be configured between 64KB up to 2GB.

Verify that the settings was correctly set, using the command below
Get-ReceiveConnector | fl ide*,maxmes*

image


Send Connectors

When the HUB server role now is gone and after the default installation of Exchange we don’t have any send connectors. So… for being able to send out mails to external recipients, let’s create a Send Connector on the CAS server.

In EAC: Go to the “Send Connectors”, found under “Mail Flow”. Press the “plus” icon for Creating a new send connector.

image

Give the send connector a friendly name and select what type it should be. Since this one I’m creating now is for sending to external recipients I’m selecting “Internet”. (Seems like we have a typo, see picture below). Press Next.

image

Select how to route those mails, either by using MX records or through a smart host(s). If you have a mail gateway then you should select smart host and type in it’s IP address. My server is just sending them directly to Internet so I’m using the MX method. Then press Next.

image

Press the “plus” icon for adding the address space this connector should use. In my case it will be “*”. Then it takes care of all domains. Press Save.

image

Then Press Next for accepting the settings you’ve just made.

Next screen will show you which source servers that should be used. Let’s add these into the connector by pressing the “plus” icon and selecting the Mailbox servers.

image

Press Finish button so the connector get’s created.

Note: By default the connector has a maximum message size of 10MB. You can’t configure the maximum send message size when creating the connector, but this can be done by editing the created connector.

Using PowerShell: Start the Exchange Management Shell, lets view the send connectors and then make the changes like above.

Get-SendConnector

Get-SendConnector| fl

This creates a new send connector using the DNS/MX method
New-SendConnector –Name “Outbound” –AddressSpaces ‘*’ –SourceTransportServers TLMB01 –MaxMessageSize 30MB

This creates a new send connector using the smarthost method

New-SendConnector –Name “Outbound” –AddressSpaces ‘*’ –SourceTransportServers TLMB01 –MaxMessageSize 30MB –DNSRoutingEnabled:$false –SmartHosts “10.10.10.10”

This creates a new send connector using the smarthost method together with using the CAS server as a proxy server for sending the mails

New-SendConnector –Name “Outbound” –AddressSpaces ‘*’ –SourceTransportServers TLMB01 –MaxMessageSize 30MB –DNSRoutingEnabled:$false –SmartHosts “10.10.10.10” –FrontEndProxyEnabled:$True

Note: The size can be configured between 0 Bytes up to 2TB.

Verify that the settings was correctly set, using the command below
Get-SendConnector| fl ide*,maxmes*

image

Certificates

As most of you already know we need to request and import a certificate for Exchange. This for having a fully working OWA, ActiveSync etc. certificates needs to be configured so let’s get started.

In EAC: Go to the “Certificates”, found under “Servers”. Select the server and press the “plus” icon for Creating a new certificate request.

image

I’m using an Internal PKI solution, so in this case I want to “Create a request for a certificate from a certificate authority”. Press Next.

image

Type in a friendly name for the certificate. Press Next.

image

If you want to create the request for a wildcard certificate, this is the checkbox you should use.
I don’t want a wildcard certificate, so I just let it be unchecked. Press Next.

image

Press Browse and select which server you want to store it on. Press Next.

image

For each service you can here type in the address, and the request will generate the names in the end. When you’re done press Next.

image

Go through the names in the list and make sure that all names that’s needed are included. Press Next.

image

Fill in Organization name, Department, Country, City and State. Press Next.

image

In my example I did type in the path to a share on my domain controller, which also is my Internal CA. Press Finish.
Example: \\tldc01\certificates\certreq.req

image

When the request is completed, it shows up with the friendly name, together with the status “Pending request”. When the certificate is issued, press the “Complete” button below the status.

image

Type in the URL path to the .cer file, my file is saved on my DC. Press OK.
Example: \\tldc01\certificates\certnew.cer

image

It’s now time for assigning the services to the certificates. This is done by selecting the certificate and press the Edit button.

image

Go to “Services” and add the one’s that should be used. Press Save.

image

Press OK.

image

Check so that the services is assigned to the certificate.

image

Using PowerShell: Start the Exchange Management Shell, lets view the existing certificates and then make a new cert request like above. Finally import the issued certificate.

Get-ExchangeCertificate

Get-ExchangeCertificate | fl

This creates a new certificate request and saves it to a share
New-ExchangeCertificate –Server TLCAS01 –GenerateRequest –FriendlyName Exchange2013-PS –PrivateKeyExportable $true –SubjectName “c=SE, s=Skane, l=Malmo, o=Testlabs, ou=Testlabs, cn=mail.testlabs.se” –DomainName  mail.testlabs.se,autodiscover.testlabs.se –RequestFile “\\tldc01\certificates\test.req”

image

Import-ExchangeCertificate –Server TLCAS01 –FileName “\\tldc01\certificates\certnew-ps.cer” –PrivateKeyExportable $true –FriendlyName Exchange2013-PS

Enable-ExchangeCertificate –Thumbprint A2E6649A22A99BEAB2654BEB403C92BB9D34B404 –Services “IIS, SMTP, POP, IMAP” –Server TLCAS01

Get-ExchangeCertificate

image

Note: Make sure to specify –Server, or else you can have difficulties finding our created request. Mine landed at my Mailbox server even if I did it on the CAS server.

If you haven’t read it already, have a look at Part 1: Complete guide of how to perform the installation

Thanks for reading, I hope that it’s informative and great reading for most of you. It would be awesome if you guys leave some comments, what do you think about Exchange 2013? Maybe you have already installed the Preview/Beta? Which new feature is the best one?

Next part will cover Databases, Outlook Anywhere, Outlook 2013 and MAPI/RPC etc.

Part 3 can be found here

Exchange Server 2013 Preview – Part 1: Complete guide of how to perform the installation

Exchange Server 2013 Preview – Part 1: Complete guide of how to perform the installation

Since Exchange Server 2013 beta was released yesterday I’m glad to announce that my first installation is done and here’s a complete walkthrough.

My setup is basic, using one server as domain controller, Windows 2008 R2.
Initially for Exchange I’m using 3 servers, 1 server for the CAS role and 2 servers for the Mailbox role.

There are some prerequisites that need to be installed/removed before the installation of Exchange can take place.

Note: It’s now recommended to install the Mailbox server first. So I’m starting with that server.

Step 1. Install the administration pack using the commands below, make sure to restart the server before proceeding to step 2.

Import-Module ServerManager
Add-WindowsFeature RSAT-ADDS

image

Step 2. Install the Windows features that Exchange uses, for Mailbox and CAS server use the command below:

Import-Module ServerManager
Add-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

image

Step 3. When the feature is completed. Continue with the installation of the required components, use the links below to download the components.

.NET Framework 4.5 RC

Windows Management Framework 4.0

Unified Communications Managed API 4.0, Core Runtime 64-bit

Office 2010 Filterpack x64

Office 2010 Filterpack SP1 x64

KB 974405 (Windows Identity Foundation)

KB 2619234 (RPC over HTTP)

KB 2533623 (Remote code execution)

Note: Make sure to uninstall the Visual C++ 11 Beta Redistributable (x64) before starting the Exchange 2013 installation.

You can have a look at the setup.exe parameters using

setup.exe /?
setup.exe /help:install

image

Step 4. Start the installation using unattended installation for the Mailbox server role

setup.exe /mode:install /roles:Mailbox, ManagementTools /IAcceptExchangeServerLicenseTerms /InstallWindowsComponents /OrganizationName:Testlabs /TargetDir:"D:\Program Files\Microsoft\Exchange Server\V15"

The installation process starts up and prepare the organization for Exchange 2013, install the necessary Windows components. The schema prep can also be done manually using setup.exe /preparead, I’ve chosen to go with the default behavior.

When for the Mailbox server role installation is successfully finished it will tell you to restart the server.

image

Step 5. Start the installation of the Windows features for the CAS server role

Import-Module ServerManager
Add-WindowsFeature RSAT-ADDS
Add-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

Make sure to restart the server after the Windows features got installed.

Step 6. Start the installation of the CAS server role

setup.exe /mode:install /roles:ClientAccess, ManagementTools /IAcceptExchangeServerLicenseTerms /InstallWindowsComponents /OrganizationName:Testlabs /TargetDir:"D:\Program Files\Microsoft\Exchange Server\V15"

Since this is the second server, the schema prep is already done so the installation will skip that step.

When it’s finished it will look like the picture below, a restart of the server is required.

image

The installation of both servers are now completed.

Next blog post will be around how to configure Exchange 2013.

Thanks for reading, looking forward to your comments about the post and also about Exchange 2013 in general.

More information about the prerequisites can be found here.

What’s new in Exchange 2013

Next blog post, Part 2: How to do the Basic configuration