script check Certificate Revocation List -CRL time update
I have a digital certificate (Certificate Revocation List -CRL) is updated automatically every day.
Seated documents:
\\ sherefoleder \ certificate \ certificate.crl
I am looking for a script to do a test every day the date of the digital certificate are of the same day
September 8th, 2015 1:32am

You can use the LastWriteTime property of the CRL and compare that value against the current date.

You can reference the below example .

FYI, my CRL is on the desktop. In your case, it would be 

Get-Item \\ sherefoleder \ certificate \ certificate.crl

if(((Get-Item .\Desktop\LatestCRL.crl).LastWriteTime).ToShortDateString() -eq ((Get-Date).ToShortDateString()))
{
	Write-Host "Same day."
}
else
{
	Write-Host "Different day."
}




Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 4:32am

You can use the LastWriteTime property of the CRL and compare that value against the current date.

You can reference the below example .

FYI, my CRL is on the desktop. In your case, it would be 

Get-Item \\ sherefoleder \ certificate \ certificate.crl

if(((Get-Item .\Desktop\LatestCRL.crl).LastWriteTime).ToShortDateString() -eq ((Get-Date).ToShortDateString()))
{
	Write-Host "Same day."
}
else
{
	Write-Host "Different day."
}




  • Edited by mukesh-kumar Tuesday, September 08, 2015 8:41 AM
September 8th, 2015 8:31am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics