Use the below code to get the list of certificate installed .
$certificates = @{}
Get-ChildItem Cert:\LocalMachine\my | % {
$cert = $_
$_.DnsNameList | % {
[string] $dnsName = $_
$certificates[$dnsName] = $cert.Thumbprint
}
}
$certificates
This code gets the children of “Cert:\LocalMachine\my ” , adds the same to an array
$certificates = @{}
Get-ChildItem Cert:\LocalMachine\my | % {
$cert = $_
$_.DnsNameList | % {
[string] $dnsName = $_
$certificates[$dnsName] = $cert.Thumbprint
}
}
$certificates
No comments:
Post a Comment