查询在邮箱上设置的转发功能:
Get-Mailbox -server MX01 -Filter {ForwardingAddress -like '*'} | Select-Object Name, ForwardingAddress | Export-Csv "D:ScriptsForwarding.csv"
查询在OUTLOOK信箱上设置的邮件规则转发:
Get-InboxRule -Mailbox "James Bond" | where {$_.RedirectTo} | fl MailboxOwnerID, RedirectTo
or
Get-InboxRule -Mailbox "James Bond" | where {$_.ForwardTo} | fl MailboxOwnerID, RedirectTo
检查所有邮箱中是否有设置转发/规则
脚本:
Set-AdServerSettings -ViewEntireForest $True
$mbxs = Get-Mailbox -server MX01 -ResultSize Unlimited
ForEach ($mbx in $mbxs){
Get-InboxRule -mailbox $mbx.primarySMTPAddress | where {$_.ForwardTo -or $_.RedirectTo} | fl MailboxOwnerID, ForwardTo, RedirectTo
}