Tuesday, May 11, 2010

Recipe for installing Exchange 2010

I have now installed enough exchange2010 servers, to have made a little document, on how to do it.
It's very simple, but here's a howto, with a configuration script, on things I know I always want's to configure.
So I hope some you can use this, no matter if you need to install one server, or many.

First, install prerequisites using this MS article:
http://technet.microsoft.com/en-us/library/bb691354.aspx

E.G. when installing mb, cas and hub roles on server 2008 R2, you'll run, in PowerShell (remember to start it as Administrator):
Import-Module ServerManager
Add-WindowsFeature NET-Framework,RSAT-ADDS,Web-Server,Web-Basic-Auth,Web-Windows-Auth,Web-Metabase,Web-Net-Ext,Web-Lgcy-Mgmt-Console,WAS-Process-Model,RSAT-Web-Server,Web-ISAPI-Ext,Web-Digest-Auth,Web-Dyn-Compression,NET-HTTP-Activation,RPC-Over-HTTP-Proxy -Restart 
Set-Service NetTcpPortSharing -StartupType Automatic
Then install the Exchange server.

When installed there's always lot of things to configure. These is different, after what scenario it's installed in.
But I found, that I always need to configure these, after installing the certificate.
The following edit, the url's for the different iis dirs.
So edit, to the correct servernames, and run in powershell:

Get-OabVirtualDirectory -server SERVERNAME | Set-OabVirtualDirectory -InternalUrl https://INTERNALHOSTNAME.DOMAIN.NET/OAB -ExternalUrl https://EXTERNALHOSTNAME.DOMAIN.NET/OAB 
Get-WebServicesVirtualDirectory -server SERVERNAME | Set-WebServicesVirtualDirectory -InternalUrl https://INTERNALHOSTNAME.DOMAIN.NET/EWS/Exchange.asmx -ExternalUrl https://EXTERNALHOSTNAME.DOMAIN.NET/EWS/Exchange.asmx
Get-OwaVirtualDirectory -server SERVERNAME | Set-OwaVirtualDirectory -InternalUrl https://INTERNALHOSTNAME.DOMAIN.NET/owa -ExternalUrl https://EXTERNALHOSTNAME.DOMAIN.NET/owa
Get-EcpVirtualDirectory -server SERVERNAME | Set-EcpVirtualDirectory -InternalUrl https://INTERNALHOSTNAME.DOMAIN.NET/ecp -ExternalUrl https://EXTERNALHOSTNAME.DOMAIN.NET/ecp
Get-ActiveSyncVirtualDirectory -server SERVERNAME | Set-ActiveSyncVirtualDirectory -InternalUrl https://INTERNALHOSTNAME.DOMAIN.NET/Microsoft-Server-ActiveSync -ExternalUrl https://EXTERNALHOSTNAME.DOMAIN.NET/Microsoft-Server-ActiveSync
Get-ClientAccessServer SERVERNAME | Set-ClientAccessServer -AutoDiscoverServiceInternalUri https://INTERNALAUTDISCOVER-URL.DOMAIN.NET/Autodiscover/Autodiscover.xml
enable-OutlookAnywhere -Server 'SERVERNAME' -ExternalHostname 'EXTERNALHOSTNAME.DOMAIN.NET' -DefaultAuthenticationMethod 'Basic' -SSLOffloading $false
Input is welcome, if you need more details.

Friday, May 7, 2010

Iisreset /noforce times out in exchange 2007 and exchange 2010

On a lot of Exchange 2007 and Exchange 2010 installations, I get timeout when running:
 "Iisreset /noforce" 
You can just run the command againg, and if it times out, run it once more, untill it completes.
BUT it's annoying and you have to monitor the command, to make sure IIS is not down more that necessary.
So I have begun just to run it as follows:
"iisreset /noforce /timeout:600"
 10 minutes is usually enough time, for iis to restart :-)


Timeout error:
Attempting stop...
Restart attempt failed.
The service did not respond to the start or control request in a timely fashion. (2147943453, 8007041d)

Thursday, May 6, 2010

The operation can't be performed on the default e-mail address policy.

When Editing the default Email address policy in Exchange 2010, I always get the error:
The operation can't be performed on the default e-mail address policy. 

(Full details in the bottom)

My workaround, is to copy the details, with ctrl-c, and paste it in notepad, and edit the command, so you'll only set the needed.
E.g. I here needed to add a  domain, and make it the reply domain. So I will run the following in Powershell (remember to run powershell as administrator):
set-EmailAddressPolicy -EnabledEmailAddressTemplates 'smtp:@ADdomain.local','SMTP:@newdomain.net' -Identity 'Default Policy'

The Full error code is, when adding a domain, and setting it as default:
Error:
The operation can't be performed on the default e-mail address policy.

Exchange Management Shell command attempted:
set-EmailAddressPolicy -ConditionalDepartment @() -ConditionalCompany @() -ConditionalStateOrProvince @() -ConditionalCustomAttribute1 @() -ConditionalCustomAttribute2 @() -ConditionalCustomAttribute3 @() -ConditionalCustomAttribute4 @() -ConditionalCustomAttribute5 @() -ConditionalCustomAttribute6 @() -ConditionalCustomAttribute7 @() -ConditionalCustomAttribute8 @() -ConditionalCustomAttribute9 @() -ConditionalCustomAttribute10 @() -ConditionalCustomAttribute11 @() -ConditionalCustomAttribute12 @() -ConditionalCustomAttribute13 @() -ConditionalCustomAttribute14 @() -ConditionalCustomAttribute15 @() -RecipientContainer $null -EnabledEmailAddressTemplates 'smtp:@ADdomain.local','SMTP:@Newdomain.net' -Name 'Default Policy' -Identity 'Default Policy'