温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Exchange Shell命令

发布时间:2020-10-17 11:08:20 来源:网络 阅读:615 作者:zjy1002261870 栏目:系统运维

发邮件记录-----

Get-TransportServer | Get-MessageTrackingLog -Sender:chengcheng1.tan@sk.com -EventId send -Start "2017-08-07 08:38" -End "2017-08-07 08:45" | Select-Object Timestamp,ClientIp,ClientHostname,ServerIp,ServerHostname,connectorid,Source,EventId,{$.recipients},{$.RecipientStatus},TotalBytes,RecipientCount,MessageSubject,Sender | Export-Csv -Path d:\exlog_sender_2017011301.csv -Encoding Unicode -NoTypeInformation
收邮件记录------

Get-TransportServer | Get-MessageTrackingLog -Recipients:yanyan.wang@sk.com -EventId send -Start 2016-12-01 | Select-Object Timestamp,ClientIp,ClientHostname,ServerIp,ServerHostname,connectorid,Source,EventId,{$.recipients},{$.RecipientStatus},TotalBytes,RecipientCount,MessageSubject,Sender | Export-Csv -Path d:\exlog_recipients_2017011301.csv -Encoding Unicode -NoTypeInformation

Get-Mailbox -Identity "590031i" | Ft Alias, Database
ExChange Shell API文档
https://docs.microsoft.com/en-us/powershell/module/exchange/mailbox-databases-and-servers/get-mailboxdatabase?view=exchange-ps
查看服务器集群的名字及版本信息
Get-ExchangeServer | Ft Name, ServerRole, Edition, AdminDisplayVersion -auto
获取DB列表及所在服务器信息
Get-MailboxDatabase | Format-List
查询MBX03_New DB所在的服务器信息
Get-MailboxDatabase -Identity MBX03_New | Format-List
查看某用户使用邮箱大小及所在DB情况
Get-Mailbox -Identity 590031I@sk.com | Get-MailboxStatistics | select DisplayName,TotalItemSize,Database
查询队列使用情况
Get-Queue

查看邮箱使用容量

get-mailboxstatistics -identity 590031i | format-list

get-mailboxstatistics -identity 590031i | ft displayname,totalitemsize,lastlogontime
查看ExchangeServer版本

Get-exchangeserver | format-list name,edition,admindisplayversion

删除某用户某时间段内邮件内容

Search-Mailbox -Identity "shilian.wu@sk.com" -SearchQuery "Received:01/01/2017..07/20/2017" -DeleteContent

1,按邮件主题删除特定用户特定邮件:
以下示例为删除用户sky里的邮件主题含有'Product Discussion'关键字的邮件。
Search-Mailbox -Identity "sky" -SearchQuery "Subject:'Product Discussion'" -DeleteContent

2,按发信人地址删除特定用户特定邮件: 
以下示例为删除用户sky里的发信人为'sharepoint@pugster.com'的邮件。
br/> 
以下示例为删除用户sky里的发信人为'sharepoint@pugster.com'的邮件。
Search-Mailbox -Identity "sky" -SearchQuery "From:'sharepoint@pugster.com'" -DeleteContent
删除来自某一邮箱的某一时间段的邮件;
Search-Mailbox -Identity "sky" -SearchQuery "From:'sharepoint@pugster.com' and Received:01/01/2001..11/01/2011" -DeleteContent

按内容关键字删除特定用户特定邮件:
 
以下示例为删除用户sky里的邮件内容里含有为Modify my alert settings的邮件。(因为sharepoint里更换发信人只是最近一个月的事,以前的sharepoint邮件要进行更仔细的甄别。)
 
Search-Mailbox -Identity "sky" -SearchQuery "body:'Modify my alert settings'" -DeleteContent
  검색된 메일을 삭제 (from 값이 jie.feng@sk.com인 메일)
-       Get-Mailbox -Resultsize Unlimited | Search-Mailbox -SearchQuery 'from:"jie.feng@sk.com"' -DeleteContent
1.     메일 삭제 전 사용자 조회(电子邮件删除前用户查询)
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery 'Subject:"离职感言"' -EstimateResultOnly | Measure-Object
 
2.     메일 삭제(删除邮件)
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery ' Subject:"离职感言"' -DeleteContent 
 
3.     삭제 후 사용자 조회 (删除后用户查询)

Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery ' Subject:"离职感言"' -EstimateResultOnly | Measure-Object

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI