If you are generating certificates using PowerShell script, and you are looking to generate certificate with more than 1 years of validity period, you may want to modify PowerShell script named as New-SelfSignedCertificates.ps1. This is located under infrastructure folder of LCS Scripts that you downloaded initially.

To do this, you can add one line of code in the given PS script. It will be around line 117 as following.

 

$commandArgs["NotAfter"] = (Get-Date).AddYears(5).ToString('dd-MM-yyyy')

 

Add this line just above the FriendlyName Parameter.

Please remember to change two values as per need

  1. Number of years such as I am giving 5 in my example i.e. add 5 years in today's date. You can add here any value of your need. Also you can add days or months etc. instead of adding Years.

  2. Keep date format as per need. I am not in USA so I wouldn’t keep Month before the day.

 

Once you are done with the changes, just save these and you should be ready to execute the PS Script, resulting in certificates with your needed expiry date.

Please note that you may want to grab certificates form a well-approved vendor as specified by Microsoft for your production system.