Switch-Certificate
업데이트 날짜: 2015년 9월
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.
별칭 |
none |
필수 여부 |
true |
위치 |
2 |
기본값 |
none |
파이프라인 입력 허용 여부 |
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.
별칭 |
none |
필수 여부 |
false |
위치 |
named |
기본값 |
none |
파이프라인 입력 허용 여부 |
false |
와일드카드 문자 허용 여부 |
false |
-OldCert<Certificate>
Specifies an X509 certificate or a certificate path in the certificate provider for the certificate to be replaced.
별칭 |
none |
필수 여부 |
true |
위치 |
1 |
기본값 |
none |
파이프라인 입력 허용 여부 |
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 등의 일반 매개 변수를 지원합니다. 자세한 내용은 TechNet의 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