Last active
December 7, 2018 11:23
-
-
Save mincaeuro/42258ef73df0e14a7d5f4be5fda56c18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# filter expired cert with "UBS" in Issuer: | |
Get-ChildItem cert:\ -Recurse | Where-Object {$_ -like "*UBS*" -and $_.NotAfter -lt (Get-Date)} | Select-Object -Property Issuer | |
# or only by keyword "UBS": | |
Get-ChildItem cert:\ -Recurse | Where-Object {$_ -like "*UBS*"} | Select-Object -Property Issuer, NotAfter | |
# run 1st cmd to check the result, if its OK you can remove it: | |
Get-ChildItem cert:\ -Recurse | Where-Object {$_ -like "*UBS*" -and $_.NotAfter -lt (Get-Date)} | Remove-Item | |
# import via PS | |
Import-PfxCertificate -FilePath $env:USERPROFILE\Desktop\certfile.p12 -CertStoreLocation Cert:\CurrentUser\My -Password (ConvertTo-SecureString -String "<password>" -Force –AsPlainText) | |
#Above script wont be accepted by Java applets, to isntall it use this inc CMD line: | |
certutil -f -ImportPFX -user -p <password> shared_erste.p12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment