Powershell
繞過 Office 365 垃圾郵件過濾器的 PowerShell 命令
我希望創建一個 Office 365 傳輸規則,以允許來自選定 IP 地址的入站電子郵件繞過垃圾郵件過濾器。
有人可以幫忙嗎?
我能想到的最接近的是:
Set-TransportRule -Name “Whitelist” -ExceptIfSenderIpRanges {1.1.1.1,2.2.2.2,3.3.3.3,4.4.4.4} -SetSCL -1
謝謝你的幫助!
CSV 文件:
cmdlet:
$IPs = Import-Csv C:\root\IP.CSV $IpRange =$IPs.IP Get-TransportRule <Rule Name> | Set-TransportRule -ExceptIfSenderIpRanges $IPRange Get-TransportRule <Rule Name> |fl ExceptIfSenderIpRanges
$UserCredential = Get-Credential Set-ExecutionPolicy RemoteSigned $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session Get-Mailbox Get-Mailbox | Set-MailboxJunkEmailConfiguration –Enabled $False