• Home
  • Topics
    • Office 365
    • Teams
    • SharePoint
    • Exchange 2019
    • Exchange 2016
    • Exchange 2013
    • Hybrid
    • Certificates
    • PowerShell
    • Migration
    • Security
    • Azure
  • Blog
  • Podcast
  • Webinars
  • Books
  • About
  • Subscribe
    • Facebook
    • Twitter
    • RSS
    • YouTube

Practical 365

You are here: Home / Exchange Server / PowerShell Script to Configure Exchange Server Client Access URLs

PowerShell Script to Configure Exchange Server Client Access URLs

August 27, 2015 by Paul Cunningham 26 Comments

ConfigureExchangeURLs.ps1 is a PowerShell script to make it quick and easy to configure the Client Access namespaces on your Exchange servers. The script is designed to apply the same namespace to all Client Access services on the server. You can specify different internal and external URLs. If you have a more complex namespace configuration to apply (for example separate namespaces for each service) then this script does not cater to your scenario, however you can probably adapt it your particular needs.

The script has some mandatory parameters:

  • -Server – The name(s) of the server(s) you are configuring.
  • -InternalURL – The internal namespace you are using.
  • -ExternalURL – The external namespace you are using.

There are some optional parameters as well, if you need them for your configuration. If you don’t use the optional parameters they default to the most common settings in my experience.

  • -AutodiscoverSCP – Used to specify a different Autodiscover namespace if required.
  • -InternalSSL – Specifies the internal SSL requirement for Outlook Anywhere. Defaults to True (SSL required).
  • -ExternalSSL – Specifies the external SSL requirement for Outlook Anywhere. Defaults to True (SSL required).

You can configure one or multiple servers at the same time. For example, to configure a single server:

1
.ConfigureExchangeURLs.ps1 -Server sydex1 -InternalURL mail.exchangeserverpro.net -ExternalURL mail.exchangeserverpro.net

To configure multiple servers:

1
.ConfigureExchangeURLs.ps1 -Server sydex1,sydex2 -InternalURL mail.exchangeserverpro.net -ExternalURL mail.exchangeserverpro.net

To use a different Autodiscover namespace:

1
.ConfigureExchangeURLs.ps1 -Server sydex1,sydex2 -InternalURL mail.exchangeserverpro.net -ExternalURL mail.exchangeserverpro.net -AutodiscoverSCP autodiscover.exchangeserverpro.net

Download ConfigureExchangeURLs.ps1 from the TechNet Gallery or Github. Questions and feedback are welcome in the comments below.

Exchange Server Client Access, Exchange 2013, Exchange 2016, PowerShell, Scripts

Comments

  1. Lee says

    June 10, 2020 at 9:27 am

    Can confirm this works on Exchange 2019. Paul I need your powershell karate skills!

    Reply
  2. CA says

    January 31, 2020 at 6:09 pm

    Hi Paul,

    i have 2 exchange 2019 servers, after running the script i am able to access the first server’s ECP by using https:///ecp and it works however, when i try the same on the second server it redirects me to https://mail..co.uk. is this normal behaviour ?

    Reply
    • CA says

      February 1, 2020 at 6:26 pm

      Sorry, should read https://serverfqdn/ecp

      Reply
  3. Andrey says

    January 24, 2020 at 10:20 pm

    Hi Paul. I stuck with autodiscover.xml on my Exchange 2016. The file is missing, therefore I am unable to configure Outlook clients. Is there a way to generate this file?

    Reply
  4. Pete Long says

    January 22, 2020 at 8:17 pm

    Once again this bailed me out today, Thanks Paul, your contributions to the online Exchange community are much appreciated!

    Pete Long

    Reply
  5. John says

    September 6, 2019 at 7:10 pm

    Has anyone used the script on 2019 Exchange?

    Reply
    • Evandro Boa Semedo says

      November 19, 2019 at 12:39 am

      Yeah, Work Perfectly.

      Reply
  6. Kanga says

    March 9, 2019 at 5:58 am

    Hi Paul, let say I have 2 ISPs . I configure mail1.mydomaine.org and mail2.mydomaine.com with each of the ISP IP address on the external domain. Then in the local domain, configure correctly the DNS entries for CAS failover and loadbalancing.
    What should I configure at the virtual directory level or at the send and receive connectors to ensure that if one of my ISP is down, the mails are still going and coming?

    Reply
  7. Jide says

    November 4, 2018 at 5:23 pm

    Hi Paul, I just tried to use this script to get my exchange URLs and suddenly i cannot connect to any of my exchange servers again. they all give “412 COOKIES ARE DISABLED”
    Any idea?

    Reply
  8. Alex says

    December 19, 2016 at 8:17 pm

    Hi Paul,

    great script!
    Just something to point out: after the execution, the MAPI authentication settings get lost.
    I don’t think this nothing to do with your script btw, since the settings are lost in any case even if you change the URL within the EAC.
    Keep up the good work!

    Regards,
    Alex

    Reply
    • Paul Cunningham says

      December 19, 2016 at 11:14 pm

      Which version and build of Exchange?

      Reply
      • Alex says

        December 22, 2016 at 7:29 pm

        2016 standard CU3, v15.1 (build 544.27).
        Thanks,
        Alex

        Reply
  9. Jean-Luc says

    December 6, 2016 at 1:01 am

    Hi Paul,

    When you do not use “AdPropertiesOnly” there are DCOM errors.
    Do you know why?
    Best regards

    Reply
    • Paul Cunningham says

      December 6, 2016 at 11:55 am

      No. Sounds like something wrong in your environment though. Using -AdPropertiesOnly just speeds things up a bit.

      Reply
  10. Ray Hicks says

    December 3, 2016 at 2:36 am

    I used these recently to configure a new 2016 deployment, thank you!

    it maybe worth noting that I had a number of these commands scripted for a 2013 deployment I did a while ago but that did not seem sufficient when I was on this 2016 deployment, so I sought help and found your scripts. After running the scripts I had to recreate the outlook profile on my test machine to clear a certificate error I was getting.

    though I did look through the script I have not bothered to figure what I was missing! These are so good they are my ‘go to’ now.

    cheers.

    Reply
  11. HB says

    November 24, 2016 at 1:47 am

    what about setting internal and external auth?

    Reply
    • Paul Cunningham says

      November 24, 2016 at 8:01 am

      What exactly do you want to know?

      Reply
  12. Mahmoud says

    August 31, 2016 at 8:02 pm

    could you please make other one with
    The default authentication basic

    Reply
    • Paul Cunningham says

      August 31, 2016 at 9:01 pm

      You’re allowed to edit the script to suit your needs.

      Reply
  13. Windozgeek says

    July 21, 2016 at 4:00 am

    Thank you for this, works great.
    Much appreciated

    Reply
  14. Morteza says

    February 25, 2016 at 4:17 am

    Hi Paul
    I uses your script and change all of URL
    but when outlook want to connect to server again try to connect with local address
    mail.domain.local

    Reply
    • Morteza says

      February 25, 2016 at 5:41 am

      and also repeatedly need password

      Reply
      • CA says

        January 31, 2020 at 11:05 am

        did you resolve this ?

        Reply
  15. Juancho says

    September 27, 2015 at 2:23 pm

    Hi Paul, thanks for magnificent contribution!

    According to TechNet “If the DefaultAuthenticationMethod parameter is specified, InternalClientAuthenticationMethod, ExternalClientAuthenticationMethodand IISAuthenticationMethodsparameters cannot be used” What if, you need to reverse that and you need/want to use Internal, External and IISAuthentication again?

    Also if you enter Get-OutlookAnywhere | fl DefaultAuthenticationMethod nothing happens. Is there a way to know if DefaultAuthentication has been set?

    Thanks!!

    Reply
  16. David says

    September 5, 2015 at 5:30 am

    What is the difference between this script and the Virtual Directory configure external access domain tool?

    Reply
    • Paul Cunningham says

      September 6, 2015 at 12:22 pm

      I cover that in an article here:
      https://practical365.com/exchange-server-2016-client-access-namespace-configuration/

      Reply

Leave a Reply Cancel reply

You have to agree to the comment policy.

Recent Articles

  • Hands-on SharePoint Syntex Blog Series – Part I
  • The Practical 365 Weekly Update: S2, Ep 8 – What to expect in 2021, Solarigate, TLS in Exchange and new Teams updates
  • Security updates released for Exchange and SharePoint Servers 2010 to 2019
  • The Practical 365 Weekly Update: S2, Ep 7 – Urgent Exchange security updates, new Teams features launch
  • How to train your users against threats with Attack Simulation Training
Practical 365

Related Posts

Related Posts

Training Courses

  • Configuring and Managing Office 365 Security
  • Office 365 Admin Playbook
  • Exchange 2016 Exam 70-345
  • Managing Exchange Mailboxes and Distribution Groups in PowerShell
  • More Training Courses...

Recommended Resources

  • Office 365 Security Resources
  • Office 365 Books
  • Exchange Server Books
  • Exchange Server Migrations
  • Exchange Analyzer
  • Digicert SSL Certificates

About This Site

Practical 365 is a leading site for Office 365 and Exchange Server news, tips and tutorials. Read more...

Find out more about advertising with us.

Contact us


Subscribe to our newsletter
  • Facebook
  • Twitter
  • RSS
  • YouTube

Copyright © 2021 Quadrotech Solutions AG · Disclosure · Privacy Policy
Alpenstrasse 15, 6304 Zug, Switzerland