I did not write this, but I liked it, so I thought I would pass it on!
Use this script to extract the ADFS signing certificate from the FederationMetadat url (https://sts.yourserver.com/FederationMetadata/2007-06/FederationMetadata.xml):
https://raw.githubusercontent.com/bergie/passport-saml/master/docs/adfs/retrieve_adfs_certificate.sh