Quantcast
Channel: Security forum
Viewing all articles
Browse latest Browse all 12072

Certutil Command Adds Unwanted Timestamp to csv

$
0
0

Hi all;

I am using the following command to pull a list of expired certificates in powershell:
<snip>

$Today=Get-Date -Format yyyyMMdd
$ReportDir="D:\ExpiryReports"

certutil -view -restrict "RequesterName=sa-service-account,NotAfter>=now,NotAfter<=now+30:00" -out "Requester Name,CommonName,NotAfter,SerialNumber,CertificateTemplate" csv > $ReportDir\ExpirationReport_$Today.csv

</snip>

The output always contains a timestamp in the header, which makes programatic work with it difficult:

"4/6/2020 12:00 AM""5/6/2020 12:00 AM""Requester Name","Issued Common Name","Certificate Expiration Date","Serial Number","Certificate Template"

Other certutil commands I use like this to generate enrollment reports do not have this timestamp. Is there a way to get rid of it in the certutil command?


Viewing all articles
Browse latest Browse all 12072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>