編集

次の方法で共有


Get-AzBatchCertificate

Gets the certificates in a Batch account.

Syntax

Get-AzBatchCertificate
   [-Filter <String>]
   [-MaxCount <Int32>]
   [-Select <String>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzBatchCertificate
   [-ThumbprintAlgorithm] <String>
   [-Thumbprint] <String>
   [-Select <String>]
   -BatchContext <BatchAccountContext>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzBatchCertificate cmdlet gets the certificates in the Azure Batch account that the BatchContext parameter specifies. To obtain a particular certificate, specify the ThumbprintAlgorithm and Thumbprint parameters. Specify the Filter parameter to get the certificates that match an Open Data Protocol (OData) filter.

Examples

Example 1: Get a certificate by thumbprint

Get-AzBatchCertificate -ThumbprintAlgorithm "sha1" -Thumbprint "C1******7C" -BatchContext $Context

Thumbprint                  : C1******7C
ThumbprintAlgorithm         : sha1
Url                         : https://pstests.eastus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=C1******47
C)
State                       : Active
StateTransitionTime         : 10/6/2015 6:21:16 PM
PreviousState               :
PreviousStateTransitionTime :
Data                        :
CertificateFormat           :
Password                    :
PublicData                  : MI******FJ
DeleteCertificateError      :

This command gets a single certificate that has the specified thumbprint. The certificate thumbprint algorithm is sha1.

Example 2: Get filtered certificates

Get-AzBatchCertificate -Filter "state eq 'active'" -BatchContext $Context

Thumbprint                  : 025b351b087a084c5067f5e71eff8591970323f9
ThumbprintAlgorithm         : sha1
Url                         : https://pstests.eastus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=02******f9)
State                       : Active
StateTransitionTime         : 10/6/2015 6:21:17 PM
PreviousState               :
PreviousStateTransitionTime :
Data                        :
CertificateFormat           :
Password                    :
PublicData                  : ********************************
DeleteCertificateError      :

Thumbprint                  : C1******7C
ThumbprintAlgorithm         : sha1
Url                         : https://pstests.eastus.batch.azure.com/certificates(thumbprintAlgorithm=sha1,thumbprint=C1******7C)
State                       : Active
StateTransitionTime         : 10/6/2015 6:21:16 PM
PreviousState               :
PreviousStateTransitionTime :
Data                        :
CertificateFormat           :
Password                    :
PublicData                  : ********************************
DeleteCertificateError      :

This command gets all certificates in the active state from the Batch account. The Filter parameter specifies the state.

Parameters

-BatchContext

Specifies the BatchAccountContext instance that this cmdlet uses to interact with the Batch service. If you use the Get-AzBatchAccount cmdlet to get your BatchAccountContext, then Microsoft Entra authentication will be used when interacting with the Batch service. To use shared key authentication instead, use the Get-AzBatchAccountKey cmdlet to get a BatchAccountContext object with its access keys populated. When using shared key authentication, the primary access key is used by default. To change the key to use, set the BatchAccountContext.KeyInUse property.

Type:BatchAccountContext
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Filter

Specifies an OData filter clause. If you specify this parameter, this cmdlet gets the certificates that match the filter.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MaxCount

Specifies the maximum number of certificates to return. If you specify a value of zero (0) or less, the cmdlet does not use an upper limit. The default value is 1000.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Select

Specifies an OData select clause. Specify a value for this parameter to get specific properties rather than all object properties.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Thumbprint

Specifies the thumbprint of the certificate that this cmdlet gets.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ThumbprintAlgorithm

Specifies the algorithm used to derive the Thumbprint parameter. Currently, the only valid value is sha1.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

String

BatchAccountContext

Outputs

PSCertificate