< Back

Get-CertificateFile

Mon Jan 13, 2020 12:27 am

NAME Get-CertificateFile



SYNOPSIS

Get certificate files from a specified path or paths and

return an object of the certificate including File name, Subject name,

the signature algorithm used, validity dates, and thumbprint.





SYNTAX

Get-CertificateFile [[-Path] <String[]>] [[-CertUtilPath] <String>] [[-CertificateFileType] <String[]>] [-Recurse]

[<CommonParameters>]





DESCRIPTION

Get certificate files from a specified path or paths and

return an object of the certificate including file name, subject name,

the signature algorithm used, validity dates, and thumbprint. The

script requires the certutil.exe to read the certificate files

and parse the text output.



Certificates in the file system used by applications may need to

be monitored and checked for expiriation as well as deprecated

cipher suites/signature algorithm (i.e. sha1, md5).





PARAMETERS

-Path <String[]>



Required? false

Position? 1

Default value .

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-CertUtilPath <String>



Required? false

Position? 2

Default value C:\\Windows\\System32\\certutil.exe

Accept pipeline input? false

Accept wildcard characters? false



-CertificateFileType <String[]>



Required? false

Position? 3

Default value ('*.cer','*.crt','*.p7b')

Accept pipeline input? false

Accept wildcard characters? false



-Recurse [<SwitchParameter>]



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Created by: Jason Wasser @wasserja

Modified Date: 10/12/2015 10:56:05 AM



Changelog:

* Version 1.2

* Added Key size property

* Version 1.1

* Fixes to work with PowerShell 2.0

* Version 1.0

* Initial Script



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-CertificateFile



Outputs a list of certificate files in the current path.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-CertificateFile -Path c:\\temp



Outputs a list of certificate files from c:\\temp.









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-CertificateFile -Path C:\\inetpub -Recurse



Outputs a list of certificate files from c:\\inetpub including subdirectories.











RELATED LINKS

https://gallery.technet.microsoft.com/s ... h-b646aeff