Last active
October 7, 2021 11:46
-
-
Save mardahl/22abcebc77092ee42cc46b45ed1541ac to your computer and use it in GitHub Desktop.
CloudFlare PowerShell to bulk delete DNS Zones
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
#license MIT | |
#Author Michael Mardahl github.com/mardahl | |
#region declarations | |
$env:CF_API_KEY = 'axxxxxxxxxxxxxxxxxxxx' | |
$env:CF_API_EMAIL= '[email protected]' | |
$domains = $(Get-Content .\domains.txt) #text file with 1 domain per line | |
#endregion declarations | |
#region execute | |
foreach ($domain in $domains){ | |
$dom = $domain.ToString() | |
Write-Verbose "Attempting to remove $dom" -verbose | |
#you need to download the latest version of flarectl to use with this script | |
.\flarectl.exe zone delete --zone="$dom" | |
} | |
#endregion execute |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment