VirtualMetric Hyper-V Monitoring, Hyper-V Reporting


Cozumpark Bilisim Portali
Autodiscover configuration for Hosted Exchange 2010 on Powershell
Posted in Exchange Server, Windows Powershell | 7 Comments | 13,075 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:

For Exchange Server 2010:

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="*"}
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=""}) -PSPath IIS:\ -location Autodiscover

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

Comments (7)

Kerry Denten

February 9th, 2010

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.




February 13th, 2010

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.


February 15th, 2010

Hello Kerry,

Here the solution:

Your MX hostname:
Your Autodiscover hostname:

Now, let’s start with DNS records:

mail.yusufozturk IN A
autodiscover.yusufozturk IN A

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

Then, IIS records:

Configure Bindings as;

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

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

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

Redirect Autodiscover requests to

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.


March 1st, 2011

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

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

Can someone please help. Thanks in advance.


June 16th, 2011


Just read the part on the page saying :

Attention: You don’t need Autodiscover configuration after Exchange Server 2010 SP1. Please check:

Could you let me know why you saying this?

Thank you.


June 21st, 2011

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.


January 10th, 2012

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