Last active
September 23, 2018 06:32
-
-
Save PsychoData/2e2891ebc40350d7ca82a6223af6be91 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
$domainslist = 'example.com','otherexample.com','otherparkeddomain.com' | |
function Check-ParkedDomains-SPF-DKIM-MX-DMARC ( | |
[Parameter(Mandatory=$true)] | |
[ValidateNotNullOrEmpty()] | |
[string[]]$domainsToCheck, | |
[switch]$PauseBetweenSets | |
) { | |
if ($domainsToCheck.Count -gt 10 ) { | |
Write-Host 'There will be 7x URLs opened for each domain in the domain list, it is recommended to batch the checks in sets of 10.' | |
$answer = Read-Host -Prompt 'Would you like to batch the check for you? (Y/N)' | |
if ($answer.ToLower().Substring(0,1) -eq 'y') { | |
$counter = [pscustomobject] @{ Value = 0 } | |
$groupSize = 10 | |
$groups = $domainsToCheck | Group-Object -Property { [math]::Floor($counter.Value++ / $groupSize) } | |
$groups | ForEach-Object { | |
Check-ParkedDomains-SPF-DKIM-MX-DMARC -domainsToCheck $($_.Group) -PauseBetweenSets | |
Exit | |
} | |
} | |
} | |
if ($PauseBetweenSets -eq $false) { | |
Write-Host 'There will be 7x URLs opened for each domain in the domain list, it is recommended to pause between check types to allow time for the URLs to load without overloading your computer.' | |
$answer = Read-Host -Prompt 'Would you like to pause between checks? (Y/N)' | |
if ($answer.ToLower().Substring(0,1) -eq 'y') { | |
Check-ParkedDomains-SPF-DKIM-MX-DMARC -domainsToCheck $domainslist -PauseBetweenSets | |
Exit | |
} | |
} | |
$domainsToCheck = $domainsToCheck | Sort-Object -Unique | |
Write-Host "Startign check for SPF on bare domain" | |
$domainsToCheck | Foreach-Object { Start-Process $("https://mxtoolbox.com/SuperTool.aspx?action=spf%3a" + "$_" + "&run=toolpage#")} | |
if ($PauseBetweenSets) {Pause} | |
Write-Host "Startign check for DKIM on bare domain" | |
$domainsToCheck | Foreach-Object { Start-Process $("https://mxtoolbox.com/SuperTool.aspx?action=dkim%3a" + "$_" + ":test" + "&run=toolpage#")} | |
if ($PauseBetweenSets) {Pause} | |
Write-Host "Startign check for MX on bare domain" | |
$domainsToCheck | Foreach-Object { Start-Process $("https://mxtoolbox.com/SuperTool.aspx?action=mx%3a" + "$_" + "&run=toolpage#")} | |
if ($PauseBetweenSets) {Pause} | |
Write-Host "Startign check for DMARC on bare domain" | |
$domainsToCheck | Foreach-Object { Start-Process $("https://mxtoolbox.com/SuperTool.aspx?action=dmarc%3a" + "$_" + "&run=toolpage#")} | |
if ($PauseBetweenSets) {Pause} | |
Write-Host "Startign check for SPF on sub domain" | |
$domainsToCheck | Foreach-Object { Start-Process $("https://mxtoolbox.com/SuperTool.aspx?action=spf%3a" + "subdom.$_" + "&run=toolpage#")} | |
if ($PauseBetweenSets) {Pause} | |
Write-Host "Startign check for MX on sub domain" | |
$domainsToCheck | Foreach-Object { Start-Process $("https://mxtoolbox.com/SuperTool.aspx?action=mx%3a" + "subdom.$_" + "&run=toolpage#")} | |
if ($PauseBetweenSets) {Pause} | |
Write-Host "Startign check for DMARC on sub domain" | |
$domainsToCheck | Foreach-Object { Start-Process $("https://mxtoolbox.com/SuperTool.aspx?action=dmarc%3a" + "subdom.$_" + "&run=toolpage#")} | |
if ($PauseBetweenSets) {Pause} | |
} | |
Check-ParkedDomains-SPF-DKIM-MX-DMARC -domainsToCheck $domainslist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment