从“其他人"中删除证书证书存储 [英] deleting certs from the "other people" certificate store

查看:102
本文介绍了从“其他人"中删除证书证书存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在做一些研究,看是否有一种方法可以编写此功能的脚本,但我似乎找不到这些证书的实际存储位置.我看到了其他有关从商店中删除证书"的文章,但我认为这些文章使我更加困惑.

I have been doing some research to see if there is a way to script this functionality and I cant seem to find where these certs are actually stored. I see the other articles on "deleting certificates from store", but I think these are causing me more confusion.

如果运行类似 get-childitem -path cert:\ CurrentUser 的搜索,则看不到 Other People 位置.但是,我可以在 certmgr.msc 中看到该位置.我还检查了此处概述的reg位置: https://technet.microsoft.com/zh-CN/library/cc783813(WS.10).aspx ,而且似乎也找不到该位置.

If I run a search like get-childitem -path cert:\CurrentUser, I don't see the Other People location. But, I am able to see the location in certmgr.msc. I have also checked the reg locations outlined here: https://technet.microsoft.com/en-us/library/cc783813(WS.10).aspx and can't seem to find the location either.

所以,我想我的问题如下:

So, I guess my question is as follows:

  1. 可以构建一个脚本来进入该位置并进行完整清理吗?
  2. 这些证书在本地系统上实际安装在哪里?

谢谢,如果这看起来有些古怪,我深表歉意.这使我的头旋转了近两个小时.谢谢.

Thank you, and I apologize if this seems a little erratic. This has been making my head spin for almost two hours. Thanks.

推荐答案

您要查找的是CurrentUser存储区的AddressBook目录.进行 gci Cert:\ CurrentUser \ AddressBook ,我敢打赌您会看到与certmgr.msc的其他人"部分中完全相同的证书.如果您不想保留所有这些证书,那么将它们全部删除就很简单:

What you are looking for is the AddressBook directory of the CurrentUser store. Do a gci Cert:\CurrentUser\AddressBook and I bet you see the exact same certificates as you do in the 'Other People' section of certmgr.msc. If you do not want to keep any of those certificates deleting them all is as simple as:

Get-ChildItem Cert:\CurrentUser\AddressBook | Remove-Item

如果您这样做,它们都会全部删除,因此请谨慎操作.只想摆脱过期的证书?添加这样的where语句:

They will all be deleted if you do that, so please do so with caution. Just want to get rid of expired certificates? Add a where statement like this:

Get-ChildItem Cert:\CurrentUser\AddressBook | Where{$_.NotAfter -lt [datetime]::Now} | Remove-Item

那只会删除过期的证书.

That one would only remove expired certificates.

无论如何,您都需要 Cert:\ CurrentUser \ AddressBook .

这篇关于从“其他人"中删除证书证书存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆