Script to check the Certificate on machine by Template name

Below is the Script to check the Certificate on machines by Template name

I used this script in MECM baseline to get output.


$certTemplate = "Company Computer"

$cert = Get-ChildItem 'Cert:\LocalMachine\My' | Where-Object{ $_.Extensions | Where-Object{ ($_.Oid.FriendlyName -eq 'Certificate Template Information') -and ($_.Format(0) -match $certTemplate) }}

If ($Cert){

$true

}Else{

$false}

No comments:

Post a Comment