Building Hosted Exchange 2010 – Part I

There’s quite a lot of demand in the market to build a hosting environment (multi tenant) based on Exchange 2010. In the past there was hosted Exchange (in Exchange 2003) and Address List Segregation (Exchange 2007) and the /Hosting option in Exchange Server 2010. The latter is no longer recommended by Microsoft and Microsoft now recommends to use an Enterprise deployment of Exchange Server 2010 SP2, combined with Address Book Policies (ABP) and a 3rd party Control Panel providing the ‘glue’ to get the various parts together.

Microsoft released a number of articles and whitepapers on the future of Exchange hosting and some guidance documents regarding building a hosting environment and migrating from an old platform to a new (Exchange 2010 SP2) platform: Continue reading Building Hosted Exchange 2010 – Part I

Unattended Setup Exchange 2010

Installing prerequisite software

Before installing the actual Exchange Server the prerequisite software needs to be installed as well. Microsoft has a couple of XML files that can be used with the command-line version of Server Manager, ServerManagerCmd.exe

These XML files can be found in the directory D:\Setup\ServerRoles\Common (where “D” is the installation source, i.e. your DVD or network share) and are named Exchange-Serverrole.XML:

image

You can start installing the prerequisite by opening a command prompt and execute the following command:

ServerManagerCmd.exe –ip Exchange-Cas.XML

This will install the prerequisite software for the Exchange 2010 Client Access Server. Although the server not always requests to I personally always recommend rebooting the server after installing the prerequisite software.

Preparing Active Directory

To prepare Active Directory for Exchange Server 2010:

setup.com /PrepareExchangeLegacyPermissions

(this step only needs to be performed when upgrading from an earlier version of Exchange)

setup.com /PrepareSchema
setup.com /PrepareAD /OrganizationName:<< name>>

(the /OrganizationName switch can be omitted when upgrading from an earlier version of Exchange)

setup.com /PrepareDomain

Install the Exchange Servers:

To install Exchange 2010 servers from the command line using the setup.com application a number of switches are available:

/mode, can be install, uninstall or upgrade

/role, can be (a combination of) CA, HT, MB, UM, MT (MT = Management Tools)

/UpdatesDir – location on disk where the setup can fine update (i.e. Update Rollup fixes) that will be included when installing Exchange Servers. This does not work when upgrading servers (unfortunately)

/LegacyRoutingServer – The Exchange 2003 SMTP server the Hub Transport Server is using to create a Legacy Routing Group Connector (only used for the 1st Hub Transport Server in an existing Exchange 2003 environment)

/LanguagePack – location on disk where the setup application can find the Language Pack files. Of course these need to be downloaded first

/ExternalCASServerDomain – The external URL the Client Access Server is using for clients accessing the server from the Internet (CAS Server only)

/EnableLecayOutlook – Creates a Public Folder database needed for Outlook 2003 clients (Mailbox Server only)

To install a combined CAS and HUB server:

setup.com /mode:install /role:CA,HT /UpdatesDir:\\InstallShare\ExchangeUpdates /LanguagePack:\\InstallShare\ExchangeLanguagePack\LanguagePackBundle.exe /ExternalCASServerDomain:webmail.contoso.com

To install a Hub Server and connect it to Exchange 2003:

setup.com /mode:install /role:HT /UpdatesDir:\\InstallShare\ExchangeUpdates /LanguagePack:\\InstallShare\ExchangeLanguagePack\LanguagePackBundle.exe /LegacyRoutingServer:2003SMTP.contoso.com

To install a Mailbox Server:

setup.com /mode:install /role:MB /UpdatesDir:\\ InstallShare \ExchangeUpdates /LanguagePack:\\ InstallShare \ExchangeLanguagePack\LanguagePackBundle.exe /EnableLegacyOutlook

image

Use an answer file

It is also possible to use an answer file for the unattended setup with the /Answerfile:c:\answerfile.txt option. you can use the following options in the answer file:

EnableLegacyOutlook

LegacyRoutingServer

ServerAdmin

ForeignForestFQDN

OrganizationName

DoNotStartTransport

UpdatesDir

EnableErrorReporting

NoSelfSignedCertificates

AdamLdapPort

AdamSslPort.

More information can be found on Microsoft TechNet: http://technet.microsoft.com/en-us/library/aa997281.aspx

POP3 Server Unavailable. 21

Recently I entered the dreaded -ERR Server Unavailable. 21 error on an Exchange Server. The strange this was that this did not happen to all mailboxes but only to a couple of mailboxes. Nothing written in the eventlog, just –ERR Server Unavailable. 21 immediately after entering my credentials (this error can be seen when using TELNET to access a mailbox using POP3).

To get more information regarding the login process you can enable POP logging on the CAS Server. Be very careful with this and only enable it for test purposes. If you forget to turn it off most likely your CAS server will shutdown in a couple of days because the system drive is filled up with POP3 log files.

Enable POP logging using the Exchange Management Shell:

Set-POPSettings –ProtocolLogEnabled:$TRUE

And don’t forget to restart the POP3 service.

The POP3 log files are stored in C:\Program Files\Microsoft\Exchange Server\V14\Logging\Pop3. After testing and the Error Server Unavailable. 21 error show up, disable logging (Set-POPSettings –ProtocolLogEnabled:$FALSE), restart the service and open the POP3 log file.

2012-03-08T21:26:02.937Z,0000000000000002,1,127.0.0.1:110,127.0.0.1:24097 ,,0,23,5,user,joe@sixpack.com,R=ok;RpcL=-1;LdapL=-1
2012-03-08T21:26:13.296Z,0000000000000002,2,127.0.0.1:110,127.0.0.1:24097 ,,46,10,29,pass,*****,"R=""-ERR Server Unavailable. 21"";RpcL=-1;LdapL=-1;
Msg=User:joe:bf6c873e-4289-4a64-87bf-2ade894947cd:DAG04-MBX05:MBX19.E14.local; Excpt=""Could not load file or assembly ‘Microsoft.Exchange.Compliance, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35’ or one of its dependencies. The system cannot find the file specified.-FileNotFoundException"""

This turns out to be a bug in the Exchange 2010 setup (even in SP1) where the POP3 config file is not created appropriately. Unfortunately the same is true for IMAP4, but the fix is identical. The config files are called Microsoft.Exchange.Pop3.exe.config and Microsoft.Exchange.Imap4.exe.config and can be found in the directory C:\program files\Microsoft\Exchange Server\V14\ClientAccess\PopImap\

Add the following pieces to the XML file (both POP3 and IMAP4):

<dependentAssembly>
<assemblyIdentity name="Microsoft.Exchange.Compliance" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<codeBase version="14.0.0.0" href="file:///C:\Program Files\Microsoft\Exchange Server\V14\bin\Microsoft.Exchange.Compliance.dll" />
</dependentAssembly>

image

Restart the POP3 and IMAP4 service and the POP3 Server Unavailable no longer appears.

Telnet for POP3 and IMAP4

For testing purposes it is useful to know how to use TELNET to access a mailbox using the POP3 or the IMAP4 protocol. Suppose you have a mail server running with POP3 and IMAP4 enabled and you want to give it a try.

POP3

On a client open a command prompt and enter TELNET <<mailserver>> 110

If the server is running fine you’ll see a welcome message (like +OK The Microsoft Exchange POP3 service is ready) and you can enter the user credentials:

User <<username>>

Pass <<password>>

image

You are now successfully logged on. If you enter the LIST command all items in the Inbox are shown. RETR 1 will retrieve the first message in this list while DELE 1 will delete this first message. Bottom line is that you are successfully logged on, POP3 is running fine and the mailbox can be accessed.

Use the QUIT command to log off from the mailbox.

IMAP4

On a client computer open a command prompt and enter TELNET <<mailserver>> 143

If the server is running fine you’ll see a welcome message (like * OK The Microsoft Exchange IMAP4 service is ready) and you can enter the user credentials:

. login <<username>> <<password>>

That is: dot space login <<username>> <<password>>, you have to enter the dot and the space before the login command. If you omit either one the login will fail!

image

To get an overview of all the folders in the inbox you can use the LIST command:

. LIST “” “*”

Again, you have to enter the dot and the space before the actual LIST command.

Use the STATUS command to get the number of messages, for example:

. status inbox (messages)

image

Logoff from an IMAP4 session is a bit peculiar, use the CTRL + ] key combination, followed by the QUIT command (to actually quit the TELNET session).

image

Useful commands for a quick test of your mailbox and the POP3 and IMAP4 services.

If you want a complete overview of all commands please check this websites:

http://bobpeers.com/technical/telnet_imap and http://bobpeers.com/technical/telnet_pop

Microsoft UC Specialist