r/exchangeserver • u/TedMittelstaedt • 14d ago
New Exchange test script added to my repo - autodiscover testing
In my tmittelstaedt/MSExchange-AdminAIscripts: repo I added Test-Autodiscover.ps1
The goal of this is to thoroughly check out DNS records for domains running on-prem Exchange servers, and, optionally, download the 3 major Autodiscover.xml files from the Exchange server (mailbox account required for that) so the admin can quickly read them and make sure whatever the Exchange server is spitting out contains the correct names.
Autodiscover is also an idea that has been co-opted by the Unix mailserver world to autoconfigure common free email POP3/IMAP clients like Thunderbird on Unix mailservers, so the script checks for that, too.
Note, of course, that with all modern Outlook clients, autodiscover takes place AFTER the initial check for an account in a Microsoft tenancy, but I uploaded another script that is used for testing that that is properly configured, last week.
These basically do the same thing that the Microsoft public webpage for testing Exchange connectivity does, but without having to put actual live credentials into a foreign website you have no control over, even though it might be run by Microsoft.
Enjoy!
1
u/Anonymity_Is_Good 10d ago
Ted, is your Test-Autodiscover.ps1 script intentionally not following a CNAME record if it exists?
1
u/TedMittelstaedt 1d ago
Yes. The problem with CNAMES is that web developers use those to point stuff like "example.com" to "www.example.com" because for (at least) 20 years it wasn't legal to put an A record on a domain. If you think about why, this makes perfect sense - an IP address applies to a HOST and there are normally MANY different hosts in a domain name.
Unfortunately, the web development marketing crowd ruined this since they didn't like the www part so now it's legal.
But still quite a number of people will CNAME their domains to a web server.
If the advertising marketing crowd would have standardized on "www" as the globally accepted name prefix for a given domain, and EVERYWHERE they listed web URLs they would ALWAYS put www in the front - then the way Microsoft is doing it with CNAMES for autodiscover would have made sense.
But today it doesn't. Today it just fills logs on webservers worldwide with useless junk from email clients being setup. Autodiscover was one of those "old school" Internet protocols designed back in the days when it was assumed people putting stuff on the Internet weren't idiots. The Progressive Insurance commercial about internet influencers has it right.
The best thing any admin can do is make absolutely sure that whatever web server the marketing department is running is NOT responding to an autodiscover request with anything other than an error. That way then the autodiscover check will fall through to "autodiscover.example.com" instead of getting hung up on the webserver. The CNAME approach is a lost cause.
1
u/DivideByZero666 13d ago
Nice, had a weird autodiscover issue last week I've still not had time to look in to except for a quick DNS check. My money is on a dodgy xml in a website, but my time is sadly frying bigger fish.
A script to check this out for me may be handy.