Download FederationMetadata.xml via PowerShell and bypass SSL certificate check

This script will download FederationMetadata.xml file on the ADFS server and bypass SSL certificate check.

Normally you would download FederationMetadata.xml via

But instead of this you receive following error message (if you’re using not properly trustable SSL certificate for ADFS FQDN metadata url):

Invoke-WebRequest : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.

 

The right solution to bypass certificate client check is this (remember to run PowerShell as Administrator):

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.