Get-MessageTrackingLog:在 Exchange Server 上搜索邮件跟踪日志
http://woshub.com/get-messagetrackinglog-on-exchange-office365/
要显示用户 Exchange 邮箱中的规则列表
Get-InboxRule –Mailbox john.doe
我们找到一个用户发送给另一个用户的所有电子邮件,并将搜索结果导出到一个 CSV 文件中:
Get-MessageTrackingLog -Sender "cmansion@woshub.com" -Recipients "amorato@woshub.com" -ResultSize unlimited –server rome-hub-01| Select-Object Timestamp,Sender,{$_.recipients},MessageSubject | Export-Csv -Path "C:\Export\exchange\exchange_tracking_logs.csv" -Encoding Default -Delimiter ";"
此示例在邮箱服务器上搜索RTA1 的邮件
Get-MessageTrackingLog -Server vxicassh1 -Start "2021/12/22 20:0:0" -End "2021/12/23 0:0:0" -Recipients "RTA1@china.com"
搜索目标邮件。包含字符串 并返回数量
Search-Mailbox -Identity "xueliang.xiao" -SearchQuery 'Subject:"test"' -EstimateResultOnly
外部邮件用邮件网关查询发送记录,内部用ECP 送达报告。
查询用户某个时间段 发送失败的邮件
Get-MessageTrackingLog -Start (Get-Date).AddDays(-2) -EventId "Fail" -Sender jian2.yang@china.com
查看xueliang.xiao发往lisi的邮件记录
get-messagetrackinglog -sender xueliang.xiao@china.com -recipients lisi@china.com
限定某人不能接收外部邮件。
Set-Mailbox -Identity xueliang.xiao -RequireSenderAuthentication Enabled $True
限制仅允许HRAdmin、SandyChen、JaneKu三位用户可以发信到HR的通讯群组信箱
Set-DistributionGroup HR -AcceptMessagesOnlyFromSendersOrMembers HRAdmin,SandyChen,JaneKu
会议室1的资源仅能够被选定的JoviKu和SandyChen两位用户进行预约:
Set-CalendarProcessing -Identity "会议室1" -AutomateProcessing AutoAc cept -BookInPolicy JoviKu, SandyChen -AllBookInPolicy $False
多用户开通邮箱
命令1:$users = cat "\\127.0.0.1\share\账号.txt"
命令2:foreach($u in $users){Get-User $u | Enable-Mailbox -Database User_CS_1 | Set-CASMailbox -ActiveSyncEnabled $false -OWAforDevicesEnabled $false -OWAEnabled $false -PopEnabled $false -ImapEnabled $false}
单个邮箱开通
Get-User user | Enable-Mailbox -Database User_CS_1 | Set-CASMailbox -ActiveSyncEnabled $false -OWAforDevicesEnabled $false -OWAEnabled $false -PopEnabled $false -ImapEnabled $false
创建群组
New-DistributionGroup -Name Team -DisplayName Team -SamAccountName Team -Alias Team -OrganizationalUnit "china.com/Users_SH/IT/Group/lH"
创建邮箱群组 如上需求,
-1.1 可把所有账户放在一个user.exe 里
-1.2 获取 user.exe
$user = cat "\\127.0.0.1\share\scrum.txt"
New-DistributionGroup -name Scrum -DisplayName Scrum -SamAccountName Scrum -Alias Scrum -OrganizationalUnit "china.com/Vxi_Users_SH/IT/Group_Email_China" -Members $user