Skip to content

Instantly share code, notes, and snippets.

function Get-WebSSLExpirationDate {
[OutputType([byte[]])]
PARAM (
[Uri]$Uri
)
if (-Not ($uri.Scheme -eq "https")) {
Write-Error "You can only get keys for https addresses"
# Define AppId, secret and scope, your tenant name and endpoint URL
$ClientID = ''
$ClientSecret = ''
$tenantDomain = "domain.onmicrosoft.com"
$emailSender = "shared@domain.com"
$emailRecipient = $emailSender
$emailSubject = "Email sent via GraphAPI"
$emailBody = "<h1>Incoming Email</h1>`n"