search
Categories
Sponsors
VirtualMetric Hyper-V Monitoring, Hyper-V Reporting
Archive
Blogroll

Badges
MCSE
Community

Cozumpark Bilisim Portali
Autodiscover configuration for Hosted Exchange 2010 on Powershell
Posted in Exchange Server, Windows Powershell | 7 Comments | 13,070 views | 09/11/2009 02:02

You need to create an Autodiscover directory in IIS and configure it. What I do with this script is creating that directory and configuring for redirection.

Attention: You don’t need Autodiscover configuration after Exchange Server 2010 SP1. Please check:
http://www.yusufozturk.info/tag/hosted-exchange

For Exchange Server 2010:

1
2
3
4
5
6
7
8
New-Item "C:\inetpub\Autodiscover_redirect" -type Directory
New-Item "C:\inetpub\Autodiscover_redirect\Autodiscover" -type Directory
New-Item "C:\inetpub\Autodiscover_redirect\Autodiscover\Autodiscover.xml"type File
Import-Module WebAdministration
Remove-WebBinding -Name “Default Web Site” -BindingInformation *:80:
New-ItemProperty IIS:\Sites\”Default Web Site” -name bindings -value @{protocol="http";bindingInformation="*:80:mail.yusufozturk.info"}
New-Item IIS:\Sites\Autodiscover -bindings (@{protocol="http";bindingInformation="*:80:"}) -PhysicalPath “C:\inetpub\Autodiscover_redirect"
Set-WebConfiguration -filter /system.webServer/httpRedirect -value (@{enabled="True"; destination="https://autodiscover.yusufozturk.info"}) -PSPath IIS:\ -location Autodiscover

You won’t get any SSL error on Outlook after changes.


Comments (7)

Kerry Denten

February 9th, 2010
06:54:50

G’day Yusuf,

I’ve installed a hosted Exchange 2010 environment which is working well, except for the Autodiscover issue.

Even though I’ve created the Autodiscover_redirect site and have configured it correctly, I still can’t get this working.

I have two issues …

By default, Exchange 2010 has installed an Autodiscover virtual directory under the default website. Do I need to remove that virtual directory and create a new Autodiscover site?

And, if I bind an IP to the default website, it breaks EMC. It’s OK if I bind an IP to 443, but not to 80. And if I remove the 80 binding from the Default website, then EMC breaks again.

So I’m stuck. Can you offer come advice?

Bear in mind, I need to tread carefully because we already have clients live on the installation so I can’t afford to break anything.

Thanks,

Kerry


admin

February 13th, 2010
13:08:28

Sorry for that Kerry. You are right, this script breaks EMC but I changed it after I saw the issue.

I’ll post here when I go to office. We don’t have any Autodiscover issue right now, I hope we can fix your issue too.


admin

February 15th, 2010
22:28:59

Hello Kerry,

Here the solution:

Your MX hostname: mail.yusufozturk.info
Your Autodiscover hostname: autodiscover.yusufozturk.info

Now, let’s start with DNS records:

mail.yusufozturk IN A 10.10.10.1
autodiscover.yusufozturk IN A 10.10.10.2

As you see, you have to seperate mx hostname and autodiscover IP addresses.

Then, IIS records:

Configure Bindings as;

Autodiscover:
type: http
hostname: blank
port: 80
ip address: 10.10.10.2

Default Web Site:
type: http
hostname: blank
port: 80
ip address: 10.10.10.1

Default Web Site:
type: https
hostname: blank
port: 443
ip address: 10.10.10.1

Redirect Autodiscover requests to https://mail.yusufozturk.info/autodiscover/autodiscover.xml

Also my Powershell script does redirect.

It has to work. We have more than three different Exchange environments with using same configuration without problem. If you are still having issues, then you need to check your SSL configuration.


Ganesh

March 1st, 2011
15:17:38

I shouldn’t have run the script, without reading the entire thread. Now my OWA is not working by domain name. https://mail.mydomain.com/owa is just giving message “Internet explorer cannot display the webpage”. However https://ipaddress/owa works fine.

All that i did was replace all “yusufozturk.info” with “mydomain.com”. Everything, except autodiscover, was working fine, till I ran this script.

Can someone please help. Thanks in advance.


Cillie

June 16th, 2011
15:09:12

Hi

Just read the part on the page saying :

Attention: You don’t need Autodiscover configuration after Exchange Server 2010 SP1. Please check:
http://www.yusufozturk.info/tag/hosted-exchange

Could you let me know why you saying this?

Thank you.


admin

June 21st, 2011
01:39:27

Actually I’m not sure why I said that. But you definitely need Autodiscover configuration on HE 2010.

I corrected my statement, sorry for misinformation. Also thanks for correction.


Nathan

January 10th, 2012
14:39:03

Hi, came across some challenges with certificate imports across multiple front end servers as the private key wasn’t on the other servers. If you are going to have multiple CAS servers an easy way to install them is to do a complete install on one of your CAS servers following the above process and then export the certificate & private key using the command (make sure you have your Thumbprint handy):

$file = Export-ExchangeCertificate -Password (Get-Credential).password -BinaryEncoded:$true

You’ll be prompted for a username & password.

After this, dump the contents of the $file variable somewhere using:

Set-Content -Path “C:\somethinghere\cert.pfx” -Value $file.FileData -Encoding Byte

Once this is done, copy over the file you’ve just created to your other CAS servers and import using the command:

Import-ExchangeCertificate -FileData ([Byte[]]$(get_content -Path c:\whereveryouput\cert.pfx -Encoding byte -ReadCount 0)) -Password:(Get-Credential).password

Once that’s done, enable the cert for the services and you should be good to go… also helps with rebuilds so keep the pfx somewhere safe.



Leave a Reply