Forum Discussion
DKIM selector1 record missing at 365
Could you please share the PowerShell scripts to check every day the presents off this records. I am having same issue.
Omayaki It is straight true, for us it works.
$mailfrom = "#####@####.###"
$mailto = "#####@####.###"
$subject = "DKIM text record check for domain "
$body = "Selector"
$body2 = "is empty"
$domain = ""
$extdomain = ""
$microsoft365 = ""
$space = " "
$dot = "."
$domain = "<domainname without extension, example microsoft"
$extdomain = "com"
$microsoft365 = "<domainname>.onmicrosoft.com"
$selector_nr = 1
$nslookup = nslookup -type=txt selector$selector_nr-$domain-$extdomain._domainkey.$microsoft365
$subjectmail = "$subject $domain.$extdomain"
$bodymail = "$body$selector_nr $body2
Please perform the procedure to correctly set the selector records for this domain"
If ($nslookup.count -lt 4) { Send-MailMessage -From $mailfrom -to $mailto -SmtpServer <mailserver> -Body $bodymail -Subject $subjectmail }
$selector_nr = 2
$nslookup = nslookup -type=txt selector$selector_nr-$domain-$extdomain._domainkey.$microsoft365
$subjectmail = "$subject $domain.$extdomain"
$bodymail = "$body$selector_nr $body2
Please perform the procedure to correctly set the selector records for this domain"
If ($nslookup.count -lt 4) { Send-MailMessage -From $mailfrom -to $mailto -SmtpServer <mailserver> -Body $bodymail -Subject $subjectmail }