if (-NOT (Get-Module -ListAvailable -Name ExchangeOnlineManagement)) { Install-Module -Name ExchangeOnlineManagement } Import-Module ExchangeOnlineManagement $UserPrincipalName = Read-Host "UserPrincipalName" $HeaderValue = Read-Host "X-PHISHTEST Header Value (default Become_More_Aware)" if ([string]::IsNullOrEmpty($HeaderValue)) { $HeaderValue = @("Become_More_Aware","CyberHoot") } Connect-ExchangeOnline -UserPrincipalName $UserPrincipalName New-TransportRule "CyberHoot Phish Testing - Bypass Spam By IP" -SenderIpRanges "3.212.253.236/32" -SetHeaderName "X-MS-Exchange-Organization-BypassClutter" -SetHeaderValue "true" -SetSCL "-1" New-TransportRule "CyberHoot Phish Testing - Bypass Junk By IP" -SenderIpRanges "3.212.253.236/32" -SetHeaderName "X-Forefront-Antispam-Report" -SetHeaderValue "SFV:SKI;CAT:NONE" New-TransportRule "CyberHoot Phish Testing - Bypass Spam By IP" -SenderIpRanges "34.235.208.123/32" -SetHeaderName "X-MS-Exchange-Organization-BypassClutter" -SetHeaderValue "true" -SetSCL "-1" New-TransportRule "CyberHoot Phish Testing - Bypass Junk By IP" -SenderIpRanges "34.235.208.123/32" -SetHeaderName "X-Forefront-Antispam-Report" -SetHeaderValue "SFV:SKI;CAT:NONE" New-TransportRule "CyberHoot Phish Testing - Bypass Spam By IP" -SenderIpRanges "44.209.10.205/32" -SetHeaderName "X-MS-Exchange-Organization-BypassClutter" -SetHeaderValue "true" -SetSCL "-1" New-TransportRule "CyberHoot Phish Testing - Bypass Junk By IP" -SenderIpRanges "44.209.10.205/32" -SetHeaderName "X-Forefront-Antispam-Report" -SetHeaderValue "SFV:SKI;CAT:NONE" New-TransportRule "CyberHoot Phish Testing - Bypass Spam By IP" -SenderIpRanges "52.200.160.242/32" -SetHeaderName "X-MS-Exchange-Organization-BypassClutter" -SetHeaderValue "true" -SetSCL "-1" New-TransportRule "CyberHoot Phish Testing - Bypass Junk By IP" -SenderIpRanges "52.200.160.242/32" -SetHeaderName "X-Forefront-Antispam-Report" -SetHeaderValue "SFV:SKI;CAT:NONE" New-TransportRule "CyberHoot Phish Testing - Bypass Spam By IP" -SenderIpRanges "54.164.218.52/32" -SetHeaderName "X-MS-Exchange-Organization-BypassClutter" -SetHeaderValue "true" -SetSCL "-1" New-TransportRule "CyberHoot Phish Testing - Bypass Junk By IP" -SenderIpRanges "54.164.218.52/32" -SetHeaderName "X-Forefront-Antispam-Report" -SetHeaderValue "SFV:SKI;CAT:NONE" New-TransportRule "CyberHoot Phish Testing - Bypass Spam By IP" -SenderIpRanges "54.240.125.36/32" -SetHeaderName "X-MS-Exchange-Organization-BypassClutter" -SetHeaderValue "true" -SetSCL "-1" New-TransportRule "CyberHoot Phish Testing - Bypass Junk By IP" -SenderIpRanges "54.240.125.36/32" -SetHeaderName "X-Forefront-Antispam-Report" -SetHeaderValue "SFV:SKI;CAT:NONE" New-TransportRule "CyberHoot Phish Testing - Bypass Spam By IP" -SenderIpRanges "54.240.125.37/32" -SetHeaderName "X-MS-Exchange-Organization-BypassClutter" -SetHeaderValue "true" -SetSCL "-1" New-TransportRule "CyberHoot Phish Testing - Bypass Junk By IP" -SenderIpRanges "54.240.125.37/32" -SetHeaderName "X-Forefront-Antispam-Report" -SetHeaderValue "SFV:SKI;CAT:NONE" New-TransportRule "CyberHoot Phish Testing - Bypass Spam By Header" -HeaderContainsMessageHeader "X-PHISHTEST" -HeaderContainsWords $HeaderValue -SetHeaderName "X-MS-Exchange-Organization-BypassClutter" -SetHeaderValue "true" -SetSCL "-1" New-TransportRule "CyberHoot Phish Testing - Bypass Junk By Header" -HeaderContainsMessageHeader "X-PHISHTEST" -HeaderContainsWords $HeaderValue -SetHeaderName "X-Forefront-Antispam-Report" -SetHeaderValue "SFV:SKI;CAT:NONE"