Switch-Certificate

Switch-Certificate

Marks one certificate as having been replaced by another certificate.

구문

Parameter Set: Default
Switch-Certificate [-OldCert] <Certificate> [-NewCert] <Certificate> [-NotifyOnly] [-Confirm] [-WhatIf] [ <CommonParameters>]

자세한 설명

The Switch-Certificate cmdlet marks one certificate as having been replaced by another certificate. This cmdlet triggers a replace certificate notification and optionally sets the renewal property on the certificate being replaced.

매개 변수

-NewCert<Certificate>

Specifies an X509 certificate or a certificate path for the certificate that replaces the certificate specified with the OldCert parameter.

별칭

없음

필수 여부

true

위치

2

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-NotifyOnly

Creates a replacement certificate notification without replacing the NewCert parameter with the OldCert parameter. This mode is useful when testing a script that was registered with the New-CertificateNotificationTask cmdlet.

별칭

없음

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-OldCert<Certificate>

Specifies an X509 certificate or a certificate path in the certificate provider for the certificate to be replaced.

별칭

없음

필수 여부

true

위치

1

기본값

없음

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-Confirm

cmdlet을 실행하기 전에 확인 메시지가 표시됩니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

-WhatIf

cmdlet이 실행될 경우 결과 동작을 표시합니다. cmdlet이 실행되지 않습니다.

필수 여부

false

위치

named

기본값

false

파이프라인 입력 적용 여부

false

와일드카드 문자 허용 여부

false

<CommonParameters>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

  • Microsoft.CertificateServices.Commands.Certificate

    The Certificate object can either be provided as a Path object to a certificate or an X509Certificate2 object.

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

  • None

예제

EXAMPLE 1

This example sets the renewal property of the certificate with the thumbprint E42DBC3B3F2771990A9B3E35D0C3C422779DACD7 as renewed by the certificate with the thumbprint 4A346B4385F139CA843912D358D765AB8DEE9FD4 and generates a replace certificate notification.

PS C:\> Switch-Certificate –OldCert cert:\LocalMachine\My\E42DBC3B3F2771990A9B3E35D0C3C422779DACD7 –NewCert cert:\LocalMachine\My\4A346B4385F139CA843912D358D765AB8DEE9FD4

EXAMPLE 2

This example locates two certificates in the machine MY store and assigns them the variables $oldCert and $newCert. This cmdlet then generates a replacement notification without changing a renewal property of the old certificate.

PS C:\> Set-Location -Path cert:\LocalMachine\My
PS C:\> $oldCert = (Get-ChildItem -Path E42DBC3B3F2771990A9B3E35D0C3C422779DACD7)
PS C:\> $newCert = (Get-ChildItem -Path 4A346B4385F139CA843912D358D765AB8DEE9FD4)
PS C:\> Switch-Certificate -OldCert $oldCert -NewCert $newCert –NotifyOnly 

관련 항목

Get-CertificateNotificationTask

New-CertificateNotificationTask

Remove-CertificateNotificationTask

Get-ChildItem

Set-Location