Gets the certificate context property from Windows Certificate Store.
Get-CertificateContextProperty -Certificate <X509Certificate2> [-PropertyName <X509CertificatePropertyType>] [<CommonParameters>] Get-CertificateContextProperty -Certificate <X509Certificate2> [-NameList] [<CommonParameters>]
Gets the certificate context property from Windows Certificate Store or serialized store (SST). When the certificate is installed in the certificate store it is possible to attach some certificate properties which are not the part of the certificate. There are number of certificate context properties, like Friendly Name, Description, Private Key Information, enrollment information, Extended Validation (EV) policies, etc. The full list of supported properties is defined in X509CertificatePropertyType enumeration.
Specifies the certificate from Windows Certificate Store or serialized (SST) store.
Required? | True |
Position? | named |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Specifies the property name to return. By default, all attached properties are returned. This parameter is not compatible with '-NameList' parameter.
Note: If specific property is requested and it is not available for the specified certificate, an exception will be thrown.
Required? | False |
Position? | named |
Default value | None |
Accept pipeline input? | false |
Accept wildcard characters? | False |
Retrives the list of attached properties as a collection of property name. You can use this information to retrieve existing certificate property. This parameter is not compatible with '-PropertyName' parameter.
Required? | False |
Position? | named |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, InformationAction, InformationVariable,
WarningAction, WarningVariable, OutBuffer, PipelineVariable and OutVariable.
For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/?LinkID=113216).
System.Security.Cryptography.X509Certificates.X509Certificate2
System.Security.Cryptography.X509Certificates.X509CertificateContextProperty
Single certificate context property
System.Security.Cryptography.X509Certificates.X509CertificateContextPropertyCollection
A collection of all attached context properties
System.Security.Cryptography.X509Certificates.X509CertificatePropertyType
A collection of X509CertificatePropertyType enum values
Author: Vadims Podans
Blog: https://www.sysadmins.lv
PS C:\> (Get-ChildItem cert:\CurrentUser\my)[0] | Get-CertificateContextProperty -NameList
Retrieves the list of populated property names for the first certificate in the 'Current User\Personal' store.
PS C:\> (Get-ChildItem cert:\CurrentUser\my)[0] | Get-CertificateContextProperty -PropertyName "ProviderInfo"
Retrieves the private key's cryptographic service provider. If presented, output information will contain CSP/KSP name, provider type and container name.
PS C:\> (Get-ChildItem cert:\CurrentUser\my)[0] | Get-CertificateContextProperty
Retrieves all available certificate context properties and their values for the specified certificate object.