I want to download the SSL certificate from, say https://www.outlook.com, using PowerShell. Is it possible? Could someone help me?
You can access the certificate store using MMC or using CertMgr. msc command. There are certificates stored for CurrentUser, ServiceAccount, and Local Computer. To access the certificate store using PowerShell, you need to access the PSDrive, and Certificates are stored in the drive called Cert as you can see below.
You can also download the certificate from the admin page for that certificate. After logging in, click “SSL Certificates” in the left navigation menu. Click on the name of the certificate you want to download. Click on “Download”.
To share more knowledge :-)
$webRequest = [Net.WebRequest]::Create("https://www.outlook.com")
try { $webRequest.GetResponse() } catch {}
$cert = $webRequest.ServicePoint.Certificate
$bytes = $cert.Export([Security.Cryptography.X509Certificates.X509ContentType]::Cert)
set-content -value $bytes -encoding byte -path "$pwd\Outlook.Com.cer"
My co-worker Michael J. Lyons shared this with me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With