This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
internet:mail:exchange:exchange_o365_powershell [2019/01/09 13:56] jcooper created |
internet:mail:exchange:exchange_o365_powershell [2019/01/30 10:57] (current) jcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | + | ||
- | [[https:// | + | |
- | + | ||
- | You can use the Exchange shell to track messages that could not be delivered because of message size issues. The RecipientStatus field in Message Tracking logs is used to store the SMTP response and enhanced status codes. The Message Tracking EventID we’re looking for is FAIL. | + | |
- | + | ||
- | **To track messages that failed because of recipient’s MaxReceiveSize: | + | |
+ | * On the machine you are connecting from install the '' | ||
+ | https:// | ||
+ | * Open PowerShell run as administrator. | ||
+ | * Allow remote signing. | ||
< | < | ||
- | Get-MessageTrackingLog -EventID FAIL | where {$_.RecipientStatus -like “*RecipSizeLimit*”} | + | Set-ExecutionPolicy RemoteSigned |
</ | </ | ||
- | + | | |
- | **To track messages that failed because of the sender’s MaxSendSize: | + | |
< | < | ||
- | Get-MessageTrackingLog -EventID FAIL | where {$_.RecipientStatus -like “*SendSizeLimit*”} | + | $LiveCred = Get-Credential |
</ | </ | ||
- | + | | |
- | **To track messages from a particular sender:** | + | |
< | < | ||
- | Get-MessageTrackingLog | + | $Session = New-PSSession |
+ | </ | ||
+ | * Open a session. | ||
+ | < | ||
+ | Import-PSSession $Session | ||
+ | </ | ||
+ | * Close a session. | ||
+ | < | ||
+ | Remove-PSSession $Session | ||
+ | </ | ||
- | Get-MessageTrackingLog -Sender foo@somedomain.com -Start (Get-Date).AddHours(-1) | + | ====== PowerShell rules commands ====== |
- | Get-MessageTrackingLog -Sender foo@somedomain.com -Recipients foo@mydomain.com | + | https://www.codetwo.com/ |
- | Get-MessageTrackingLog -Sender foo@somedomain.com -Recipients foo@mydomain.com, | + | https:// |
- | </ | + | * Get Inbox Rule |
- | **Find messages by recipient:** | + | :!: To get the entire RuleIdentity you may need to widen the PowerShell window. |
< | < | ||
- | Get-MessageTrackingLog | + | Get-InboxRule |
+ | </ | ||
+ | * Get Inbox Rule and show what it does | ||
+ | < | ||
+ | Get-InboxRule –Mailbox < | ||
+ | </ | ||
+ | * Get Inbox Rule and show details | ||
+ | < | ||
+ | Get-InboxRule -Identity < | ||
+ | </ | ||
+ | * Remove Inbox rule | ||
+ | < | ||
+ | Remove-InboxRule -Identity < | ||
+ | </ | ||
+ | * Remove all Inbox rules | ||
+ | < | ||
+ | Get-InboxRule -Mailbox < | ||
+ | </ | ||
- | Get-MessageTrackingLog -Recipients *@gmail.com | ||
- | Get-MessageTrackingLog -Start (Get-Date).AddHours(-1) | Where-Object {$_.recipients -like " | ||
- | |||
- | Get-MessageTrackingLog -Start (Get-Date).AddHours(-1) | Where-Object {$_.recipients -match " | ||
- | </ | ||
- | :!: The '' |