Subject Parameter (Get-Certificate Cmdlet)

Specifies the subject of the certificate to get.

Syntax

Get-Certificate -Subject string

Remarks

If not specified, the cmdlet will return a list of certificates found in the CertStore. Otherwise, the full details for the specified certificate will be returned.

When this parameter is set, a search is performed in the current certificate store certificate with matching subject.

If an exact match is not found, the store is searched for subjects containing the value of the parameter.

When setting the parameter to a partial subject, CN= should be omitted. For example, the following code would find the certificate with subject CN=Test Certificate, OU=People, C=US

Example (Searching with partial subject)


-certsubject "Test"

If a match is not found, the parameter is set to an empty string, and no certificate is selected.

The special value "*" picks a random certificate in the certificate store.

Default Value

"*"

Copyright (c) 2022 /n software inc. - All rights reserved.
NetCmdlets 2020 - Version 20.0 [Build 8319]