Skip to content

Commit 7efa6e1

Browse files
authored
Merge pull request MicrosoftDocs#8688 from MicrosoftDocs/TM-chrisda
TM-chrisda to Master
2 parents 5202239 + 8d54fc8 commit 7efa6e1

File tree

3 files changed

+347
-0
lines changed

3 files changed

+347
-0
lines changed
Lines changed: 344 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,344 @@
1+
---
2+
external help file: Microsoft.Exchange.ServerStatus-Help.xml
3+
online version: https://docs.microsoft.com/powershell/module/exchange/test-message
4+
applicable: Exchange Server 2013, Exchange Online
5+
title: Test-Message
6+
schema: 2.0.0
7+
author: chrisda
8+
ms.author: chrisda
9+
ms.reviewer:
10+
---
11+
12+
# Test-Message
13+
14+
## SYNOPSIS
15+
This cmdlet is available or functional only in the cloud-based service.
16+
17+
Use the Test-Message cmdlet to simulate and report on the effects of mail flow rules (transport rules) and unified DLP rules on test email messages. Because this cmdlet introduces email into the DLP evaluation pipeline, actions such as Block, Moderate, etc. can take place on the test message. Related notifications will also be sent to any configured recipients.
18+
19+
**Note**: We recommend that you use the Exchange Online PowerShell V2 module to connect to Exchange Online PowerShell. For instructions, see [Connect to Exchange Online PowerShell](https://docs.microsoft.com/powershell/exchange/connect-to-exchange-online-powershell).
20+
21+
For information about the parameter sets in the Syntax section below, see [Exchange cmdlet syntax](https://docs.microsoft.com/powershell/exchange/exchange-cmdlet-syntax).
22+
23+
## SYNTAX
24+
25+
### Default
26+
```
27+
Test-Message
28+
[-Confirm]
29+
[-TransportRules]
30+
[-WhatIf]
31+
[<CommonParameters>]
32+
```
33+
34+
### SecOpsOverrideRules
35+
```
36+
Test-Message -Recipients <ProxyAddressCollection>
37+
[-Confirm]
38+
[-Force]
39+
[-MessageFileData <Byte[]>]
40+
[-Sender <SmtpAddress>]
41+
[-SendReportTo <RecipientIdParameter>]
42+
[-WhatIf]
43+
[<CommonParameters>]
44+
```
45+
46+
### PhishSimOverrideRules
47+
```
48+
Test-Message -Recipients <ProxyAddressCollection>
49+
[-Confirm]
50+
[-Force]
51+
[-MessageFileData <Byte[]>]
52+
[-Sender <SmtpAddress>]
53+
[-SendReportTo <RecipientIdParameter>]
54+
[-WhatIf]
55+
[<CommonParameters>]
56+
```
57+
58+
### UnifiedDLPRules
59+
```
60+
Test-Message -Recipients <ProxyAddressCollection> [-UnifiedDlpRules]
61+
[-Confirm]
62+
[-Force]
63+
[-MessageFileData <Byte[]>]
64+
[-Sender <SmtpAddress>]
65+
[-SendReportTo <RecipientIdParameter>]
66+
[-WhatIf]
67+
[<CommonParameters>]
68+
```
69+
70+
### TransportRulesWithContent
71+
```
72+
Test-Message -Recipients <ProxyAddressCollection> [-UnifiedDlpRules]
73+
[-Confirm]
74+
[-Force]
75+
[-MessageFileData <Byte[]>]
76+
[-Sender <SmtpAddress>]
77+
[-SendReportTo <RecipientIdParameter>]
78+
[-WhatIf]
79+
[<CommonParameters>]
80+
```
81+
82+
### TransportRules
83+
```
84+
Test-Message -Recipients <ProxyAddressCollection> [-TransportRules] [-UnifiedDlpRules]
85+
[-Confirm]
86+
[-Force]
87+
[-MessageFileData <Byte[]>]
88+
[-Sender <SmtpAddress>]
89+
[-SendReportTo <RecipientIdParameter>]
90+
[-WhatIf]
91+
[<CommonParameters>]
92+
```
93+
94+
### JunkMail
95+
```
96+
Test-Message -Recipients <ProxyAddressCollection>
97+
[-Confirm]
98+
[-Force]
99+
[-MessageFileData <Byte[]>]
100+
[-Sender <SmtpAddress>]
101+
[-SendReportTo <RecipientIdParameter>]
102+
[-WhatIf]
103+
[<CommonParameters>]
104+
```
105+
106+
### InboxRules
107+
```
108+
Test-Message -Recipients <ProxyAddressCollection>
109+
[-Confirm]
110+
[-Force]
111+
[-MessageFileData <Byte[]>]
112+
[-Sender <SmtpAddress>]
113+
[-SendReportTo <RecipientIdParameter>]
114+
[-WhatIf]
115+
[<CommonParameters>]
116+
```
117+
118+
### Arbitration
119+
```
120+
Test-Message -Recipients <ProxyAddressCollection> -Sender <SmtpAddress> -SendReportTo <RecipientIdParameter>
121+
[-Confirm]
122+
[-Force]
123+
[-WhatIf]
124+
[<CommonParameters>]
125+
```
126+
127+
## DESCRIPTION
128+
You need to be assigned permissions before you can run this cmdlet. Although this topic lists all parameters for the cmdlet, you may not have access to some parameters if they're not included in the permissions assigned to you. To find the permissions required to run any cmdlet or parameter in your organization, see [Find the permissions required to run any Exchange cmdlet](https://docs.microsoft.com/powershell/exchange/find-exchange-cmdlet-permissions).
129+
130+
## EXAMPLES
131+
132+
### Example 1
133+
```powershell
134+
$data = Get-Content -Path "C:\Data\test.eml" -Encoding Byte -ReadCount 0
135+
Test-Message -MessageFileData $data -Sender [email protected] -Recipients [email protected] -SendReportTo [email protected] -TransportRules -UnifiedDlpRules
136+
```
137+
138+
This example uses the test.eml message file at C:\Data to test mail flow rules and unified DLP rules for the sender [email protected] to the recipient [email protected]. The results report is sent to [email protected].
139+
140+
## PARAMETERS
141+
142+
### -Recipients
143+
The Recipients parameter specifies the recipient email address to use for the test message.
144+
145+
You can specify multiple email addresses separated by commas.
146+
147+
```yaml
148+
Type: ProxyAddressCollection
149+
Parameter Sets: SecOpsOverrideRules, PhishSimOverrideRules, UnifiedDLPRules, TransportRulesWithContent, TransportRules, JunkMail, InboxRules, Arbitration
150+
Aliases:
151+
Applicable: Exchange Online
152+
153+
Required: True
154+
Position: Named
155+
Default value: None
156+
Accept pipeline input: False
157+
Accept wildcard characters: False
158+
```
159+
160+
### -Sender
161+
The Sender parameter specifies the sender email address to use for the test message.
162+
```yaml
163+
Type: SmtpAddress
164+
Parameter Sets: Arbitration
165+
Aliases:
166+
Applicable: Exchange Online
167+
168+
Required: True
169+
Position: Named
170+
Default value: None
171+
Accept pipeline input: False
172+
Accept wildcard characters: False
173+
```
174+
175+
```yaml
176+
Type: SmtpAddress
177+
Parameter Sets: SecOpsOverrideRules, PhishSimOverrideRules, UnifiedDLPRules, TransportRulesWithContent, TransportRules, JunkMail, InboxRules
178+
Aliases:
179+
Applicable: Exchange Online
180+
181+
Required: False
182+
Position: Named
183+
Default value: None
184+
Accept pipeline input: False
185+
Accept wildcard characters: False
186+
```
187+
188+
### -SendReportTo
189+
The SendReportTo parameter specifies the target email address for the command results.
190+
191+
```yaml
192+
Type: RecipientIdParameter
193+
Parameter Sets: Arbitration
194+
Aliases:
195+
Applicable: Exchange Online
196+
197+
Required: True
198+
Position: Named
199+
Default value: None
200+
Accept pipeline input: False
201+
Accept wildcard characters: False
202+
```
203+
204+
```yaml
205+
Type: RecipientIdParameter
206+
Parameter Sets: SecOpsOverrideRules, PhishSimOverrideRules, UnifiedDLPRules, TransportRulesWithContent, TransportRules, JunkMail, InboxRules
207+
Aliases:
208+
Applicable: Exchange Online
209+
210+
Required: False
211+
Position: Named
212+
Default value: None
213+
Accept pipeline input: False
214+
Accept wildcard characters: False
215+
```
216+
217+
### -TransportRules
218+
The TransportRules switch specifies that you want to test mail flow rules. You don't need to specify a value with this switch.
219+
220+
```yaml
221+
Type: SwitchParameter
222+
Parameter Sets: Default, TransportRules
223+
Aliases:
224+
Applicable: Exchange Server 2013, Exchange Online
225+
226+
Required: True
227+
Position: Named
228+
Default value: None
229+
Accept pipeline input: False
230+
Accept wildcard characters: False
231+
```
232+
233+
### -UnifiedDlpRules
234+
The UnifiedDlpRules switch specifies that you want to unified DLP rules. You don't need to specify a value with this switch.
235+
236+
```yaml
237+
Type: SwitchParameter
238+
Parameter Sets: UnifiedDLPRules
239+
Aliases:
240+
Applicable: Exchange Online
241+
242+
Required: True
243+
Position: Named
244+
Default value: None
245+
Accept pipeline input: False
246+
Accept wildcard characters: False
247+
```
248+
249+
```yaml
250+
Type: SwitchParameter
251+
Parameter Sets: TransportRulesWithContent, TransportRules
252+
Aliases:
253+
Applicable: Exchange Online
254+
255+
Required: False
256+
Position: Named
257+
Default value: None
258+
Accept pipeline input: False
259+
Accept wildcard characters: False
260+
```
261+
262+
### -Confirm
263+
The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on if the cmdlet requires confirmation before proceeding.
264+
265+
- Destructive cmdlets (for example, Remove-\* cmdlets) have a built-in pause that forces you to acknowledge the command before proceeding. For these cmdlets, you can skip the confirmation prompt by using this exact syntax: `-Confirm:$false`.
266+
- Most other cmdlets (for example, New-\* and Set-\* cmdlets) don't have a built-in pause. For these cmdlets, specifying the Confirm switch without a value introduces a pause that forces you acknowledge the command before proceeding.
267+
268+
```yaml
269+
Type: SwitchParameter
270+
Parameter Sets: (All)
271+
Aliases: cf
272+
Applicable: Exchange Server 2013, Exchange Online
273+
274+
Required: False
275+
Position: Named
276+
Default value: None
277+
Accept pipeline input: False
278+
Accept wildcard characters: False
279+
```
280+
281+
### -Force
282+
The Force switch specifies whether to suppress warning or confirmation messages. You can use this switch to run tasks programmatically where prompting for administrative input is inappropriate. You don't need to specify a value with this switch.
283+
284+
```yaml
285+
Type: SwitchParameter
286+
Parameter Sets: SecOpsOverrideRules, PhishSimOverrideRules, UnifiedDLPRules, TransportRulesWithContent, TransportRules, JunkMail, InboxRules, Arbitration
287+
Aliases:
288+
Applicable: Exchange Online
289+
290+
Required: False
291+
Position: Named
292+
Default value: None
293+
Accept pipeline input: False
294+
Accept wildcard characters: False
295+
```
296+
297+
### -MessageFileData
298+
The MessageFileData parameter specifies the .eml message file to test.
299+
300+
A valid value for this parameter requires you to read the file to a byte-encoded object using the Get-Content cmdlet. For example, `([Byte[]](Get-Content -Encoding Byte -Path "C:\My Documents\<filename>" -ReadCount 0))`.
301+
302+
```yaml
303+
Type: Byte[]
304+
Parameter Sets: SecOpsOverrideRules, PhishSimOverrideRules, UnifiedDLPRules, TransportRulesWithContent, TransportRules, JunkMail, InboxRules
305+
Aliases:
306+
Applicable: Exchange Online
307+
308+
Required: False
309+
Position: Named
310+
Default value: None
311+
Accept pipeline input: False
312+
Accept wildcard characters: False
313+
```
314+
315+
### -WhatIf
316+
The WhatIf switch simulates the actions of the command. You can use this switch to view the changes that would occur without actually applying those changes. You don't need to specify a value with this switch.
317+
318+
```yaml
319+
Type: SwitchParameter
320+
Parameter Sets: (All)
321+
Aliases: wi
322+
Applicable: Exchange Server 2013, Exchange Online
323+
324+
Required: False
325+
Position: Named
326+
Default value: None
327+
Accept pipeline input: False
328+
Accept wildcard characters: False
329+
```
330+
331+
### CommonParameters
332+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](https://go.microsoft.com/fwlink/p/?LinkID=113216).
333+
334+
## INPUTS
335+
336+
###
337+
338+
## OUTPUTS
339+
340+
###
341+
342+
## NOTES
343+
344+
## RELATED LINKS

exchange/exchange-ps/exchange/exchange.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,8 @@ Exchange PowerShell is built on Windows PowerShell technology and provides a pow
23282328

23292329
### [Get-SupervisoryReviewTopCasesReport](Get-SupervisoryReviewTopCasesReport.md)
23302330

2331+
### [Test-Message](Test-Message.md]
2332+
23312333
## role-based-access-control Cmdlets
23322334
### [Add-ManagementRoleEntry](Add-ManagementRoleEntry.md)
23332335

exchange/mapping/serviceMapping.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@
11471147
"Get-SupervisoryReviewPolicyReport": "reporting",
11481148
"Get-SupervisoryReviewReport": "reporting",
11491149
"Get-SupervisoryReviewTopCasesReport": "reporting",
1150+
"Test-Message": "reporting",
11501151
"Add-ManagementRoleEntry": "role-based-access-control",
11511152
"Add-RoleGroupMember": "role-based-access-control",
11521153
"Get-ManagementRole": "role-based-access-control",

0 commit comments

Comments
 (0)