Export MetaData.xml with Powershell on a ADFS 3.0 server
To be able to configure SAML SSO using ADFS as Identity Provider you need the metadata.xml from your ADFS server.
Because I love consistency and simple scripts I’d like to share 4 simple rules to export your metadata.xml from your ADFS server.
1 2 3 4 5 |
#Export MetaData XML $mUrl = (Get-ADFSEndpoint | where Protocol -eq "Federation Metadata").FullUrl.ToString() $httpHelper = new-object System.Net.WebClient $metadataAsString = $httpHelper.DownloadString($mUrl) $httpHelper.DownloadFile($mUrl , "C:\Users\$($env:username)\Desktop\metadata.xml") |
Awesome stuff thank you!
SWEETNESS!
Greatly appreciated. worked perfect
Great script, success on first run, thanks.