次の方法で共有


Remove-AzVpnClientRootCertificate

Removes an existing VPN client root certificate.

構文

Default (既定)

Remove-AzVpnClientRootCertificate
    -VpnClientRootCertificateName <String>
    -VirtualNetworkGatewayName <String>
    -ResourceGroupName <String>
    -PublicCertData <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

説明

The Remove-AzVpnClientRootCertificate cmdlet removes the specified root certificate from a virtual network gateway. Root certificates are X.509 certificates that identify your Root Certification Authority: all other certificates used on the gateway trust the root certificate. If you remove a root certificate computers that use the certificate for authentication purposes will no longer be able to connect to the gateway. When you use Remove-AzVpnClientRootCertificate, you must supply both the certificate name and a text representation of the certificate data. For more information about the text representation of a certificate see the PublicCertData parameter description.

Example 1: Remove a client root certificate from a virtual network gateway

$Text = Get-Content -Path "C:\Azure\Certificates\ExportedCertificate.cer"
$CertificateText = for ($i=1; $i -lt $Text.Length -1 ; $i++){$Text[$i]}
Remove-AzVpnClientRootCertificate -PublicCertData $CertificateText -ResourceGroupName "ContosoResourceGroup" -VirtualNetworkGatewayName "ContosoVirtualGateway" -VpnClientRootCertificateName "ContosoRootCertificate"

This example removes a client root certificate named ContosoRootCertificate from the virtual network gateway ContosoVirtualGateway. The first command uses the Get-Content cmdlet to get a previously-exported text representation of the certificate; this text representation is stored in a variable named $Text. The second command then uses a for loop to extract all the text in $Text except for the first line and the last line. This extracted text is stored in a variable named $CertificateText. The third command uses the information stored in the $CertificateText variable along with the Remove-AzVpnClientRootCertificate cmdlet to remove the certificate from the gateway.

パラメーター

-DefaultProfile

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

パラメーターのプロパティ

型:IAzureContextContainer
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-PublicCertData

Specifies the text representation of the root certificate to be removed. To obtain the text representation, export your certificate in .cer format (using Base64) encoding, then open the resulting file in a text editor. You should see output similar to the following (note that the actual output will contain many more lines of text than the abbreviated sample shown here): ----- BEGIN CERTIFICATE ----- MIIC13FAAXC3671Auij9HHgUNEW8343NMJklo09982CVVFAw8w ----- END CERTIFICATE ----- The PublicCertData is made up of all the lines between the first line (----- BEGIN CERTIFICATE -----) and the last line (----- END CERTIFICATE -----) in the file. You can retrieve the PublicCertData using Windows PowerShell commands similar to this: $Text = Get-Content -Path "C:\Azure\Certificates\ExportedCertificate.cer" $CertificateText = for ($i=1; $i -lt $Text.Length -1 ; $i++){$Text[$i]}

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-ResourceGroupName

Specifies the name of the resource group that the virtual network gateway is assigned to. Resource groups categorize items to help simplify inventory management and general Azure administration.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-VirtualNetworkGatewayName

Specifies the name of the virtual network gateway that the certificate is removed from.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-VpnClientRootCertificateName

Specifies the name of the client root certificate that this cmdlet removes.

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:ResourceName

パラメーター セット

(All)
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

入力

String

出力

Boolean