Share-n-dipity

SharePoint serendipity is the effect by which one accidentally discovers something fortunate, especially while looking for something else entirely. In this case, it is the occassional musings, observations, and Ouija board readings about the phabulously

Some Easy PowerShell to Export the Token Signing Certificate from SharePoint 2010

Some Easy PowerShell to Export the Token Signing Certificate from SharePoint 2010

  • Comments 2
  • Likes

I know this has been a pain of varying magnitudes for folks over the last couple of years, so I thought I would share some nice PowerShell I stumbled upon recently.  It allows you to export the token signing certificate of the local SharePoint farm's STS.  You can then use this for things like getting the thumbprint to use when setting up a federated trust with a WCF endpoint, etc.  To get the cert saved locally, just use these two PowerShell commands:

$stsCert = (Get-SPSecurityTokenServiceConfig).LocalLoginProvider.SigningCertificate

$stsCert.Export("Cert") | Set-Content "C:\STS.cer" -Encoding byte

That exports the certificate into a file on your C:\ drive called STS.cer.

Comments
Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment