How To Export ADFS 2.0 Metadata File.

Query King | Thu, 29 Jun 2017 at 07:42 hours | Replies : 2 | Points : 50

Category : ADFS


Hi Experts,

Please help to export metadata xml from ADFS 2.0. Thanks


This Question is already solved Click To See The Answer


 Hi Query King,

There is two way to export the ADFS Metadata. Please see the steps below.

Via GUI

The specified path for ADFS 2.0 Metadata is https://ADFS-ServerName/FederationMetadata/2007-06/FederationMetadata.xml, Replace ADFS-ServerName with your actual server name. 

  1. Go to Internet Explorer or any web browser.

  2. Type  https://ADFS-ServerName/FederationMetadata/2007-06/FederationMetadata.xml

  3. Go to File Menu and click on “Save As…”, Enter the name for XML file and click on Save. 

Via PowerShell 

  1. Login into your ADFS Server and Start "Windows PowerShell Modules" not ""Windows PowerShell"

  2. Run below command. 

$mdbUrl = (Get-ADFSEndpoint | where-object {$_.Protocol -eq "Federation Metadata"}).FullUrl.ToString()
$httpHelper = new-object System.Net.WebClient
$metadataAsString = $httpHelper.DownloadString($mdbUrl)
$httpHelper.DownloadFile($mdbUrl , "C:\Users\$($env:username)\Desktop\metadata.xml")

 Hope it will help you.

 

Thank Santosh, 2nd Option is rather easier.