$SigningCert = Get-ChildItem Cert:\CurrentUser\My\ | Where-Object {$_.Thumbprint -eq "<thumbprint>"}
That's a bit clunky. Is there a better way to do that? Filter the import, I mean, so it only uses the cert that has the Code Signing entitlement?
$SigningCert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert
It might return multiple results, so you may need to filter based on subject or NotAfter
|
|
Damien
Solodow
|
||||||||||
--
You received this message because you are subscribed to the Google Groups "ntpowershell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
ntpowershell...@googlegroups.com.
To view this discussion visit
https://groups.google.com/d/msgid/ntpowershell/CAHBr%2B%2BiVnoWpXRb%3DGaJG-3onUDphPZxor5PNiUGUE6LtGHg7MQ%40mail.gmail.com.
FWIW, I set execution policy via GPO, domain-wide, not on individual hosts.
Also (and this may not matter at all), when I sign the script, I add a time stamp server parameter. I’m not even sure why I added that.
Set-AuthenticodeSignature -TimestampServer http://timestamp.sectigo.com?td=sha256 -FilePath $PathToScript -Certificate $CodeSignCert
--
John Wright
IT Support Specialist
![]()
1800 Old Bluegrass Avenue, Louisville, KY 40215
Please submit IT requests to Hazelwoo...@bluegrass.org
24 Hour Helpline 1.800.928.8000
CONFIDENTIALITY NOTICE: This message contains confidential information and is intended only for the individual(s) addressed in the message. If you are not the named addressee, you should not disseminate, distribute, or copy this e-mail. If you are not the intended recipient, you are notified that disclosing, distributing, or copying this e-mail is strictly prohibited.
From: ntpowe...@googlegroups.com <ntpowe...@googlegroups.com>
On Behalf Of Mike Leone
Sent: Wednesday, February 25, 2026 11:58 AM
To: NTPowershell Mailing List <ntpowe...@googlegroups.com>
Subject: [ntpowershell] Code signing practices question
|
EXTERNAL EMAIL - This email was sent by a person from outside your organization. Exercise caution when clicking links, opening attachments or taking further action, before validating its authenticity. |
--
$SigningCert = Get-ChildItem Cert:\CurrentUser\My\ | Where-Object {$_.Thumbprint -eq "<thumbprint>"}
That's a bit clunky. Is there a better way to do that? Filter the import, I mean, so it only uses the cert that has the Code Signing entitlement?
$SigningCert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert
It might return multiple results, so you may need to filter based on subject or NotAfter
AFAIK, yes, you’ll need to push the certificate to the store. I use a GPO that’s set at computer config>policies>windows settings>security settings>public key policies. Right-click on the key, import, browse to the cert.
To view this discussion visit https://groups.google.com/d/msgid/ntpowershell/CAHBr%2B%2BgaA5uXPJxqbQ6UDq%3D1jEvauJE9uGcL%2BobCZDyEEiHuPQ%40mail.gmail.com.