Last active
October 5, 2023 02:44
-
-
Save Rugby-Ball/aee4f671454dff5f9c7976545e4ed225 to your computer and use it in GitHub Desktop.
Using the PowerShell Module DomainHealthChecker, pull all AWS Hostedzone ID's and pull inventory of SPF records for each HostedZone. #Utility #Inventory #AWS #Route_53 #SPF #email #Public
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
| # aws-rt53-hostedzone-spf-inventory.ps1 | |
| #Install-Module -name DomainHealthChecker # Only needed if you don't already have the Module installed | |
| import-module -name DomainHealthChecker, AWSPowerShell.netcore | |
| $all = @() | |
| $urls_check = Get-R53HostedZoneList | |
| foreach ($url in $urls_check) { | |
| $all += get-spfrecord -Name $url.name | Select-Object @{ name="HostedZoneID";e={$url.id.substring(12)} }, @{ name="HostedZone";e={$url.name.trimend(".")} } , SPFRecord | |
| } | |
| $all | sort-object HostedZone | Format-Table -AutoSize -Wrap #| clip # replace clip with pbcopy for MacOS - Copies output to clipboard |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment