<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>KenBen's blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/kenben/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/kenben/feed.xml</link>
    <description>I&amp;#039;m just a caveman. I fell on some ice and was later thawed by some of your scientists. Your world frightens and confuses me!</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:47:23 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>How to easily decode the userCertificate or caCertificate attribute in Active Directory (with only the tools built into Windows)</title>
      <link>https://docs.microsoft.com/archive/blogs/kenben/how-to-easily-decode-the-usercertificate-or-cacertificate-attribute-in-active-directory-with-only-the-tools-built-into-windows</link>
      <pubDate>Sun, 21 Apr 2013 17:17:36 GMT</pubDate>
      <dc:creator><![CDATA[GoKenBen]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/kenben/2013/04/21/how-to-easily-decode-the-usercertificate-or-cacertificate-attribute-in-active-directory-with-only-the-tools-built-into-windows/</guid>
      <description><![CDATA[How many times have you needed to manipulate a certificate attribute in AD and been confronted with...]]></description>
      <content:encoded><![CDATA[<p>How many times have you needed to manipulate a certificate attribute in AD and been confronted with something that looks like this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/8688.1.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/8688.1.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/8688.1.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/8688.1.png" alt="" border="0" /></a></p>
<p>You know that you want to delete one of the certs, but which one is the one you want to delete? Or the one you want to keep?</p>
<p>The first time I ever had to deal with this was with a customer who had trouble with smartcard logon. They had 8 certificates in their NTAuth store and they only needed 2. I reached out to one of my colleagues on how to deal with this. She said that those certificates are too difficult to parse in AD. She added that the easiest way was to delete all the certificates from the store and just install the 2 we wanted. I figured there had to be an easier way, but did it just to get smartcard login working that day.</p>
<p>Later I ran into it again with a computer account which needed to have some old published certificates deleted from its object in AD. This time I vowed to find a better way and I did.</p>
<p>Clearly these are hexadecimal representations of the cert, but is the resulting output of the conversion readable? Besides, how do you convert without some special tools or going out to the internet?</p>
<p>It turns out that all you need is built into Windows.</p>
<p>First of all, let&rsquo;s grab the hex. Edit a certificate and right-click in the attribute and <strong>Select All</strong>:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/0675.2.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/0675.2.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/0675.2.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/0675.2.png" alt="" border="0" /></a><br />&nbsp; <br />Now paste that into Notepad and save it as a file. I&rsquo;ll call mine <em>cert.hex</em>.</p>
<p>Next, run <strong>certutil &ndash;decodehex cert.hex cert.txt</strong> (because the resulting file will be text &ndash; well, at least some of it will be readable)</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/0564.3.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/0564.3.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/0564.3.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/0564.3.png" alt="" border="0" /></a>&nbsp;&nbsp; </p>
<p>Open the resulting file in notepad. You should see some interesting items that are readable.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/0447.4.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/0447.4.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/0447.4.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/0447.4.png" alt="" border="0" /></a>&nbsp;&nbsp;</p>
<p>Specifically, you can read the <span style="color: #999999;">Issuing CA</span>, <span style="color: #0000ff;">Subject</span>, <span style="color: #00ff00;">issued</span> and <span style="color: #ff0000;">expiration</span> dates and times. If you look around you&rsquo;ll see all sorts of other goodies that might meet your needs for ruling out or in the certificate.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/2804.5.png" original-url="https://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/2804.5.png"><img src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/96/92/2804.5.png" original-url="https://blogs.technet.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-96-92/2804.5.png" alt="" border="0" /></a>&nbsp;&nbsp;</p>
<p>The one item I&rsquo;d like to also find is the certificate template. If anybody knows an easy way to identify this from the output, please share!</p>
<p>P. S. This also should work for the userSMIMECertificate attribute.</p>]]></content:encoded>
    </item>
  </channel>
</rss>