Skip to content

Instantly share code, notes, and snippets.

@notesbytom
Last active November 29, 2017 16:14
Show Gist options
  • Save notesbytom/4e7bbf7c5b8613ae6dc25ef6848811a7 to your computer and use it in GitHub Desktop.
Save notesbytom/4e7bbf7c5b8613ae6dc25ef6848811a7 to your computer and use it in GitHub Desktop.
Active Directory Certificate Services list certs that expire in future
REM Change the filter and column list as needed to match your query needs.
set filter="Disposition = 20,NotAfter > 11/29/2017"
set columns="NotAfter,CommonName,DistinguishedName,DispositionMessage,Disposition,CertificateTemplate,NotBefore,SerialNumber"
certutil -view -restrict %filter% -out %columns% >certutil_view_issued_notexpired.txt
REM see https://blogs.technet.microsoft.com/pki/2008/10/03/disposition-values-for-certutil-view-restrict-and-some-creative-samples/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment