Author Posts

January 14, 2016 at 1:26 pm

Hi all very new to working with certs, especially with powershell

Scenario:

i need to delete/expire/revoke certificates held on a server issued by a certain common name

i can connect to the server fine with invoke-command however i have no idea where to start on looking through the certs attributes (I tried the -filter switch of get-childitem but it reported it did not support filters)

TIA

January 14, 2016 at 1:30 pm

You'll probably just need to pipe to Where-Object for this one. Something like:

Invoke-Command -ComputerName Whatever -ScriptBlock {
    Get-ChildItem Cert:\ -Recurse |
    Where-Object { $_.Issuer -eq 'CN=DigiCert SHA2 Assured ID Code Signing CA, OU=www.digicert.com, O=DigiCert Inc, C=US' }
}

January 14, 2016 at 2:18 pm

many thanks Dave,

could i just replace get-childitem with remove-item?