How to get the expiration date after a certificate deployment?

Duchemin, Dominique 2,006 Reputation points
2022-04-21T02:33:58.14+00:00

Hello,

I am looking for a process in Configuration Manager to get the expiration date on a certificate.
I just deployed a certificate and it is placed in an application folder as CA.cer.

Powershell?

Thanks,
Dom

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,319 questions
Microsoft Configuration Manager
{count} votes

Accepted answer
  1. Luis Rodriguez 6,191 Reputation points Microsoft Employee
    2022-04-21T08:46:08.597+00:00

    Hi @Duchemin, Dominique

    Welcome to Microsoft Q&A Platform.

    Can you try using the cmdlet "Get-ChildItem"?, for example:

    Get-ChildItem -path cert:\LocalMachine\My | Select-Object NotAfter, Subject  
    

    For reference: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/about/about_certificate_provider?view=powershell-7.2

    I hope this helps!

    ----------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. AllenLiu-MSFT 39,056 Reputation points Microsoft Vendor
    2022-04-22T07:28:49.26+00:00

    Hi, @Duchemin, Dominique

    Thank you for posting in Microsoft Q&A forum.

    ConfigMgr doesn't collect any information about certificate by default.
    You may start for adding this follow this article:
    http://www.sccm-tools.com/tools/vbscript/vbscript-certificates.html
    (Please Note: Since the website is not hosted by Microsoft, just for your reference.)


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

  2. Limitless Technology 39,296 Reputation points
    2022-04-25T03:33:50.007+00:00

    Hello @Duchemin, Dominique

    Not sure I understand your question. System Center is not the right tool to monitor certificate expiration dates, but they need to be controlled from the CA role in Windows or using powershell.

    I can recommend the next official guide to obtain different information from the certificates installed in your environment and even export to a CSV to keep it documented.

    https://devblogs.microsoft.com/scripting/get-certificate-info-into-a-csv-by-using-powershell/

    If you query is different than this, please add more details and specifics of what has been done, and what you are are trying to achieve.

    Hope this helps with your query,

    ---------
    --If the reply is helpful, please Upvote and Accept as answer--

    1 person found this answer helpful.
    0 comments No comments