-
Notifications
You must be signed in to change notification settings - Fork 1
Find Certificate
external help file: CertAdmin.dll-Help.xml Module Name: CertAdmin online version: https://msdn.microsoft.com/library/system.security.cryptography.x509certificates.x509findtype.aspx schema: 2.0.0
Searches a certificate store for certificates.
Find-Certificate [-FindValue] <Object> [[-FindType] <X509FindType>] [[-StoreName] <StoreName>]
[[-StoreLocation] <StoreLocation>] [-Valid] [-NotArchived] [-Require] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Searches for certificates in the Windows Certificate Store.
PS C:\> Find-Certificate -FindValue ExampleCert -FindType FindBySubjectName -StoreName TrustedPeople -StoreLocation LocalMachine
Searches Cert:\LocalMachine\TrustedPeople for a certificate with a subject name of "ExampleCert".
Find-Certificate ExampleCert FindBySubjectName TrustedPeople LocalMachine
Uses positional parameters to search Cert:\LocalMachine\TrustedPeople for a cert with subject of "ExampleCert".
The value to search for, usually a string.
For a FindType of FindByTimeValid, FindByTimeNotYetValid, or FindByTimeExpired, the FindValue must be a datetime. For a FindType of FindByApplicationPolicy or FindByCertificatePolicy, the FindValue can be a string or a System.Security.Cryptography.Oid. For a FindType of FindByKeyUsage, the FindValue can be a string or an int bitmask.
Type: Object
Parameter Sets: (All)
Aliases: Value
Required: True
Position: 0
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe field of the certificate to compare to FindValue. e.g. FindBySubjectName, FindByKeyUsage, FindByIssuerDistinguishedName
For a FindType of FindByTimeValid, FindByTimeNotYetValid, or FindByTimeExpired, the FindValue should be a datetime. For a FindType of FindByApplicationPolicy or FindByCertificatePolicy, the FindValue can be a string or a System.Security.Cryptography.Oid. For a FindType of FindByKeyUsage, the FindValue can be a string or an int bitmask.
Omitting a FindType or StoreName will search all stores and common fields.
Type: X509FindType
Parameter Sets: (All)
Aliases: Type, Field
Accepted values: FindByThumbprint, FindBySubjectName, FindBySubjectDistinguishedName, FindByIssuerName, FindByIssuerDistinguishedName, FindBySerialNumber, FindByTimeValid, FindByTimeNotYetValid, FindByTimeExpired, FindByTemplateName, FindByApplicationPolicy, FindByCertificatePolicy, FindByExtension, FindByKeyUsage, FindBySubjectKeyIdentifier
Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe name of the certificate store to search. e.g. My, TrustedPeople, Root
Omitting a FindType or StoreName will search all stores and common fields.
Type: StoreName
Parameter Sets: (All)
Aliases:
Accepted values: AddressBook, AuthRoot, CertificateAuthority, Disallowed, My, Root, TrustedPeople, TrustedPublisher
Required: False
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseWhether to search the certificates of the CurrentUser or the LocalMachine.
Type: StoreLocation
Parameter Sets: (All)
Aliases:
Accepted values: CurrentUser, LocalMachine
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseWhether to further filter search results by checking the effective and expiration dates.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseWhether to further filter search results by excluding certificates marked as archived.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseWhether to throw an error if a certificate is not found.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.