Removes a certificate from a store for the user or machine account.
Uninstall-Certificate -Thumbprint <String> -StoreLocation {CurrentUser | LocalMachine} -StoreName {AddressBook | AuthRoot | CertificateAuthority | Disallowed | My | Root | TrustedPeople | TrustedPublisher} [-WhatIf] [-Confirm] [<CommonParameters>]
Uninstall-Certificate -Certificate <X509Certificate2> -StoreLocation {CurrentUser | LocalMachine} -StoreName {AddressBook | AuthRoot | CertificateAuthority | Disallowed | My | Root | TrustedPeople | TrustedPublisher} [-WhatIf] [-Confirm] [<CommonParameters>]
Uses .NET's certificates API to remove a certificate from a given store for the machine or current user. Use the thumbprint or friendly name to identify which certificate to remove. The thumbprint is unique to each certificate. Friendly names are not guaranteed to be unique. The user performing the removal must have permission on the store where the certificate is located.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Thumbprint | String | The thumbprint of the certificate to remove. | true | false | |
Certificate | X509Certificate2 | The certificate to remove | true | false | |
StoreLocation | StoreLocation | The location of the certificate's store. | true | false | |
StoreName | StoreName | The name of the certificate's store. | true | false | |
WhatIf | SwitchParameter | false | false | ||
Confirm | SwitchParameter | false | false | ||
CommonParameters | This cmdlet supports common parameters. For more information type Get-Help about_CommonParameters . |
Uninstall-Certificate -Thumbprint 570895470234023dsaaefdbcgbefa -StoreLocation CurrentUser -StoreName My
Removes the 570895470234023dsaaefdbcgbefa certificate from the current user's Personal certificate store.
$cert = Get-Certificate -FriendlyName 'Carbon Testing Certificate' -StoreLocation LocalMachine -StoreName Root
Uninstall-Certificate -Certificate $cert -StoreLocation LocalMachine -StoreName Root
Removes the certificate with friendly name 'Carbon Testing Certificate' from the local machine's Trusted Root Certification Authorities store.