# FriendlyName is not returning the Template name

**URL:** <https://forums.powershell.org/t/friendlyname-is-not-returning-the-template-name/6858>\
**Category:** PowerShell Help\
**Created:** [July 21, 2016, 1:21am UTC](https://forums.powershell.org/t/friendlyname-is-not-returning-the-template-name/6858 "2016-07-21T01:21:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![windows-liveuser25](https://avatars.discourse-cdn.com/v4/letter/w/ac8455/32.png) [@windows-liveuser25](https://forums.powershell.org/u/windows-liveuser25)\
**Post date:** [July 21, 2016, 1:21am UTC](https://forums.powershell.org/t/friendlyname-is-not-returning-the-template-name/6858/1 "2016-07-21T01:21:37Z")

</div>

FriendlyName is not returning the Template name  
All are ok only I need the certificate Template name. Given the Script below.

* * *

$Computers = Get-Content D:\Biswajit-temp\dc\_list.txt -ReadCount 0  
$CompNum= $Computers.count  
$Today = (Get-Date).ToString(“yyyy/MM/dd“)  
$EightWeeks= (Get-Date).AddDays(+100).ToString(“yyyy/MM/dd“)  
$a = “”  
$a = $a + “BODY{background-color:#d6eaf8;font-family:verdana;font-size:8pt;}”  
$a = $a + “TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}”  
$a = $a + “TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}”  
$a = $a + “TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:palegoldenrod}”  
$a = $a + “”  
$i=0  
Clear-content D:\Biswajit-temp\CertReport.htm  
while($i –lt $CompNum)  
{  
Write-Host “Working on:” $Computers[$i]  
$Certs = invoke-command –ComputerName $Computers[$i] –ScriptBlock {Get-ChildItem Cert:\LocalMachine\My -Recurse}  
$CertCount=$certs.count  
$j=0  
while($j –lt $CertCount)  
{  
if (($Certs[$j].NotAfter –gt $Today) -and ($Certs[$j].NotAfter –lt $EightWeeks) )  
{  
$Certs[$j] | ConvertTo-Html -head $a -title “Certificate Expiry Information” -property PSComputerName,Subject,NotAfter,@{Label=“Expires In (Days)”;Expression={($\_.NotAfter - (Get-Date)).Days}},FriendlyName,Thumbprint,SerialNumber \>\> D:\Biswajit-temp\CertReport.htm  
}  
++$j  
}  
++$i

}

if  
((Get-Content “D:\Biswajit-temp\CertReport.htm”) –eq $Null)  
{  
Write-Host “N/A”  
}  
else  
{

$body = Get-Content D:\Biswajit-temp\CertReport.htm -Raw  
Send-MailMessage -To [Biswajit.Biswas@contoso.com](mailto:Biswajit.Biswas@contoso.com) -from [No-Reply@contoso.com](mailto:No-Reply@contoso.com) -Subject “Certificate Report” -Body $body -BodyAsHtml -SmtpServer [mail.contoso.com](http://mail.contoso.com)  
}

---

<div class="post-metadata">

**Author:** ![dan-potter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/dan-potter/32/138_2.png) [@dan-potter](https://forums.powershell.org/u/dan-potter)\
**Post date:** [July 21, 2016, 5:54am UTC](https://forums.powershell.org/t/friendlyname-is-not-returning-the-template-name/6858/2 "2016-07-21T05:54:12Z")

</div>

Explore the extensions property of the certificates.

---

<div class="post-metadata">

**Author:** ![windows-liveuser25](https://avatars.discourse-cdn.com/v4/letter/w/ac8455/32.png) [@windows-liveuser25](https://forums.powershell.org/u/windows-liveuser25)\
**Post date:** [July 21, 2016, 6:32am UTC](https://forums.powershell.org/t/friendlyname-is-not-returning-the-template-name/6858/3 "2016-07-21T06:32:55Z")

</div>

Any link \ URL pls.

---

<div class="post-metadata">

**Author:** ![dan-potter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/dan-potter/32/138_2.png) [@dan-potter](https://forums.powershell.org/u/dan-potter)\
**Post date:** [July 21, 2016, 7:07am UTC](https://forums.powershell.org/t/friendlyname-is-not-returning-the-template-name/6858/4 "2016-07-21T07:07:45Z")

</div>

[https://powershell.org/forums/topic/finding-the-template-of-a-certificate/](https://powershell.org/forums/topic/finding-the-template-of-a-certificate/)

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:40pm UTC](https://forums.powershell.org/t/friendlyname-is-not-returning-the-template-name/6858/5 "2024-05-16T20:40:51Z")

</div>


