Get-Certificate
Get-Certificate [-CertStoreLocation <String>] [-Credential <PkiCredential>] [-DnsName <String[]>] [-SubjectName<String>] [-Url <Uri>] -Template* <String> [-Confirm] [-WhatIf] [<CommonParameters>]
Get-Certificate [-Credential <PkiCredential>] -Request* <Certificate> [-Confirm] [-WhatIf] [<CommonParameters>]
The Get-Certificate cmdlet can be used to submit a certificate request and install the resulting certificate, install a certificate from a pending certificate request, and enroll for ldap. If the request is issued, then the returned certificate is installed in the store determined by the CertStoreLocation parameter and return the certificate in the EnrollmentResult structure with status Issued. If the request is made pending, then the request is installed in the machine REQUEST store and a request is returned in the EnrollmentResult structure with status Pending.
This cmdlet can be used in a Stateless mode where this cmdlet does not look up anything in the vault or in a Stateful mode where it looks at registered certificate enrollment policy servers by identifier (ID) and credential. When used with a request object and no credential, this cmdlet will look up credentials in the vault based on the URL for the enrollment policy server.
This cmdlet will not accept a policy server identifier (ID). If a URL is not specified, then only the default certificate enrollment policy ID is used and the cmdlet will attempt to obtain policy information from any of its URLs.
Delegation may be required when using this cmdlet with Windows PowerShellr remoting and changing user configuration.
Parameters
-CertStoreLocation [<String>]
Specifies the path to the certificate store for the received certificate. If the request is made pending, then the request object is saved in the corresponding request store. Note: Only My store is supported.
-Credential [<PkiCredential>]
Specifies the credential to use for certificate enrollment. The credential can be a user name and password (a credential object), an X509 certificate, or the path to a certificate. If a credential is not specified, then Kerberos authentication is used.
-DnsName [<String[]>]
Specifies one or more DNS names to be included in the certificate request as subject alternative name extension.
-Request <Certificate>
- This value is required
- Accepts pipeline input ByValue
Specifies the X509 certificate or the path to a requested certificate located in the request store.
-SubjectName [<String>]
Specifies the subject name to be included in the certificate request.
-Template <String>
- This value is required
Specifies the object identifier or name of a certificate template to use with the certificate request.
-Url [<Uri>]
- Accepts pipeline input ByValue
Specifies the policy server URL to use for certificate enrollment. Credentials are required if the endpoint requires a user name and password or certificate authentication from the client. If credentials are not found and Windows PowerShellr is in interactive mode, then a prompt for credentials will appear.
-Confirm [<SwitchParameter>]
- Default value is false
Prompts you for confirmation before running the cmdlet.Prompts you for confirmation before running the cmdlet.
-WhatIf [<SwitchParameter>]
- Default value is false
Shows what would happen if the cmdlet runs. The cmdlet is not run.Shows what would happen if the cmdlet runs. The cmdlet is not run.
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.
Inputs
System.Security.Cryptography.X509Certificates.X509Certificate2Outputs
Microsoft.CertificateServices.Commands.EnrollmentResultThis work is licensed under a Creative Commons Attribution 4.0 International. It is attributed to Microsoft Corporation and can be found here.
PowerShell Commands