{"id":144,"date":"2013-12-11T16:43:41","date_gmt":"2013-12-11T16:43:41","guid":{"rendered":"https:\/\/teacheritblog.wordpress.com\/?p=144"},"modified":"2013-12-11T16:43:41","modified_gmt":"2013-12-11T16:43:41","slug":"powershell-oneliner-delete-personal-machine-certificates","status":"publish","type":"post","link":"https:\/\/christianlehrer.com\/?p=144","title":{"rendered":"#Powershell Oneliner: Delete Personal \/ Machine Certificates"},"content":{"rendered":"<div class=\"shariff\" data-title=\"#Powershell Oneliner: Delete Personal \/ Machine Certificates\" data-info-url=\"http:\/\/ct.de\/-2467514\" data-backend-url=\"https:\/\/christianlehrer.com\/wp-content\/plugins\/shariff-sharing\/backend\/index.php\" data-temp=\"\/tmp\" data-ttl=\"60\" data-service=\"tlxr\" data-services='[\"facebook\",\"twitter\",\"linkedin\",\"xing\",\"reddit\",\"whatsapp\",\"mail\",\"info\"]' data-image=\"\" data-url=\"https:\/\/christianlehrer.com\/?p=144\" data-lang=\"en\" data-theme=\"white\" data-orientation=\"horizontal\"><\/div><p>While searching for a solution to delete a personal machine certificate, I again found Powershell to provide the best solution. <\/p>\n<p>Let\u00b4s say you have a machine certificate Issued by CA \u201ctestca.domain.bla\u201d and want to delete it. This is solved in a one liner in Powershell Version 3:<\/p>\n<blockquote>\n<p>&#160;<\/p>\n<p><em>get-childitem -path cert:localmachinemy | where {$_.Issuer -like &#8216;*testca*&#8217;} |<\/em> <em>remove-item<\/em><\/p>\n<\/blockquote>\n<p><em><\/em><\/p>\n<p>In Powershell Version 4, you could also use:<\/p>\n<blockquote>\n<p><em>Get-ChildItem -Path cert:LocalMachinemy -DnsName *domain* | Remove-Item<\/em><\/p>\n<\/blockquote>\n<p>to remove all Certificates with the dnsname *domain* in the name.<\/p>\n<p>The parameter \u201cDnsName\u201d was introduced with Powershell Version 4.<\/p>\n<p>Instead of the path cert:LocalMachine you could use cert:CurrentUser for the User certificates. <\/p>\n<p>Once again PowerShell ISE will help you find your way by autosensing even the certificate paths!<\/p>\n<p>Really easy!<\/p>\n<p>&#160;<\/p>\n<p>more at <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/hh847855.aspx\" target=\"_blank\">TechNet<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>While searching for a solution to delete a personal machine certificate, I again found Powershell to provide the best solution. Let\u00b4s say you have a machine certificate Issued by CA \u201ctestca.domain.bla\u201d and want to delete it. This is solved in a one liner in Powershell Version 3: &#160; get-childitem -path cert:localmachinemy | where {$_.Issuer -like&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14],"tags":[43,84,85],"_links":{"self":[{"href":"https:\/\/christianlehrer.com\/index.php?rest_route=\/wp\/v2\/posts\/144"}],"collection":[{"href":"https:\/\/christianlehrer.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/christianlehrer.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/christianlehrer.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/christianlehrer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=144"}],"version-history":[{"count":0,"href":"https:\/\/christianlehrer.com\/index.php?rest_route=\/wp\/v2\/posts\/144\/revisions"}],"wp:attachment":[{"href":"https:\/\/christianlehrer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/christianlehrer.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/christianlehrer.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}