Exchange 2010 – 2013 Certificate

Hello all,

last project of mine we had a headache with all of the certificate errors.

I found this great script online and did a few changes to it and it works great.

What it actually does is replaces the Internal URL’s for all Virtual Directories on IIS for Autodiscover and OWA.

Once you have finished the New-ExchangeCertificateWizard and you assign services all u need to do is:

  • Copy the following code into a txt file and rename the extentions to a ps1
  • Open Exchange Managment Shell and navigate to the location where the file is saved
  • Use tab in powershell to get the correct run syntax
  • Run it, then a Question Appears type the correct FQDN like this when prompted: If your useing a Local Self Signed Certificate run this : https://CASServer.domain.local , Public Certificate such as GO Daddy :

The Script :

$urlpath = Read-Host “Type internal Client Access FQDN starting with http:// or https://”

Set-AutodiscoverVirtualDirectory -Identity * –internalurl “$urlpath/autodiscover/autodiscover.xml”
Set-ClientAccessServer –Identity * –AutodiscoverServiceInternalUri “$urlpath/autodiscover/autodiscover.xml”
Set-webservicesvirtualdirectory –Identity * –internalurl “$urlpath/ews/exchange.asmx”
Set-oabvirtualdirectory –Identity * –internalurl “$urlpath/oab”
Set-owavirtualdirectory –Identity * –internalurl “$urlpath/owa”
Set-ecpvirtualdirectory –Identity * –internalurl “$urlpath/ecp”
Set-ActiveSyncVirtualDirectory -Identity * -InternalUrl “$urlpath/Microsoft-Server-ActiveSync”
#get commands to to doublecheck the config
get-AutodiscoverVirtualDirectory | ft identity,internalurl
get-ClientAccessServer | ft identity,AutodiscoverServiceInternalUri
get-webservicesvirtualdirectory | ft identity,internalurl
get-oabvirtualdirectory | ft identity,internalurl
get-owavirtualdirectory | ft identity,internalurl
get-ecpvirtualdirectory | ft identity,internalurl
get-ActiveSyncVirtualDirectory | ft identity,internalurl


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s