renew Exchange 2016/19 SSL certificate

Get-ExchangeCertificate | Where {$_.IsSelfSigned -eq $false} | Format-List FriendlyName, CertificateDomains, Thumbprint, NotAfter

$certrequest = Get-ExchangeCertificate -Thumbprint B26C3C9B30A2A7371767275043816466CB921738 | New-ExchangeCertificate -GenerateRequest -PrivateKeyExportable:$true

[System.IO.File]::WriteAllBytes(‘\EX19-01\C$\temp\certrequest.txt’,[System.Text.Encoding]::Unicode.GetBytes($certrequest))

Get-ExchangeCertificate | Format-Table Subject, Status

Import-ExchangeCertificate -FriendlyName mail.exchangeservergeek.com -FileData ([System.IO.File]::ReadAllBytes(‘\EX19-01\C$\Users\\Desktop\mail_exchangeservergeek_com.cer’)) -PrivateKeyExportable $true

Get-ExchangeCertificate | Format-Table Subject, Thumbprint, NotAfter

Enable-ExchangeCertificate -Server EX19-01 –Thumbprint BD09E758DF572307128D878697D3A766BDBEBF35 –Services IIS,SMTP