title: How can I use PowerShell to find a website's certificate?
body: <p>I am trying to use PowerShell to query a website and see what SSL certificate (name) it is using for HTTPS bindings. Then I would like to trace back to see what CA issued the cert. </p>
  
  <p>I am having trouble querying the website to find out what SSL certificate is bound. The IIS 7.5 GUI shows a friendly name. </p>
  
  <p>After I get the websites SSL certificate the plan is to use PowerShell to search the Certificate stores by <code>FriendlyName</code> (or thumbprint, or some other value).</p>
  
  <p>Here is what I have so far:</p>
  
  <ul>
  <li><p>Query store for cert info:</p>
  
  <pre><code>get-childitem cert:\LocalMachine\my | ft issuer, subject, notafter, FriendlyName
  </code></pre></li>
  <li><p>check for active bindings</p>
  
  <pre><code>get-itemproperty 'IIS:\Sites\(SITENAME)' -name bindings
  </code></pre></li>
  </ul>
  
  <p>I'm not sure where this information is stored, and I have no luck searching for it with PowerShell, in the <code>web.config</code> and <code>applicationhost.config</code>. Google searching has not been helpful so far.</p>
  
  <p>Any info, links to information, or documentation on how certs are handled / stored in IIS is appreciated.</p>