Skip to content

Commit 70c5f76

Browse files
committed
Updates due to customer escalations.
1 parent c2e360c commit 70c5f76

File tree

2 files changed

+140
-46
lines changed

2 files changed

+140
-46
lines changed

exchange/exchange-ps/exchange/New-ClientAccessRule.md

Lines changed: 70 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ms.reviewer:
1212
# New-ClientAccessRule
1313

1414
## SYNOPSIS
15+
1516
This cmdlet is functional only in Exchange Server 2019 and in the cloud-based service. Some parameters and settings may be exclusive to one environment or the other.
1617

1718
Use the New-ClientAccessRule cmdlet to create client access rules. Client access rules help you control access to your organization based on the properties of the connection.
@@ -20,7 +21,7 @@ For information about the parameter sets in the Syntax section below, see [Excha
2021

2122
## SYNTAX
2223

23-
```
24+
```powershell
2425
New-ClientAccessRule [-Name] <String> -Action <ClientAccessRulesAction>
2526
[-AnyOfAuthenticationTypes <MultiValuedProperty>]
2627
[-AnyOfClientIPAddressesOrRanges <MultiValuedProperty>]
@@ -45,29 +46,41 @@ New-ClientAccessRule [-Name] <String> -Action <ClientAccessRulesAction>
4546
```
4647

4748
## DESCRIPTION
48-
Client access rules are like mail flow rules (also known as transport rules) for client connections to your organization. You use conditions and exceptions to identify the connections based on their properties, and actions that allow or block the connections.
4949

50-
**Note**: Currently, not all authentication types are supported for all protocols. The supported authentication types per protocol are described in this list:
50+
Client access rules are like mail flow rules (also known as transport rules) for client connections to your organization. You use conditions and exceptions to identify the connections based on their properties, and actions that allow or block the connections.
5151

52-
- ExchangeActiveSync: BasicAuthentication, OAuthAuthentication, and CertificateBasedAuthentication.
53-
- ExchangeAdminCenter: BasicAuthentication and AdfsAuthentication.
54-
- IMAP4: BasicAuthentication and OAuthAuthentication.
55-
- OutlookWebApp: BasicAuthentication and AdfsAuthentication.
56-
- POP3: BasicAuthentication and OAuthAuthentication.
57-
- RemotePowerShell: BasicAuthentication and NonBasicAuthentication.
52+
**Note**: Not all protocols support authentication type filters. Additionally, not all authentication types are supported for each protocol where authentication filters are supported. The supported authentication types per protocol are in the following table. Please use caution when mixing protocol and authentication types in the same rule.
53+
54+
|Protocol|Auth filter supported|BasicAuthentication|OAuthAuthentication|AdfsAuthentication|CertificateBasedAuthentication|NonBasicAuthentication|
55+
|---|:---:|:---:|:---:|:---:|:---:|:---:|
56+
|ExchangeActiveSync|Yes|Yes|Yes|No|Yes|No|
57+
|ExchangeAdminCenter|Yes|Yes|No|Yes|No|No|
58+
|ExchangeWebServices|No|N/A|N/A|N/A|N/A|N/A|
59+
|IMAP4|Yes|Yes|Yes|No|No|No|
60+
|OfflineAddressBook|No|N/A|N/A|N/A|N/A|N/A|
61+
|OutlookAnywhere|No|N/A|N/A|N/A|N/A|N/A|
62+
|OutlookWebApp|Yes|Yes|No|Yes|No|No|
63+
|POP3|Yes|Yes|Yes|No|No|No|
64+
|PowerShellWebServices|No|N/A|N/A|N/A|N/A|N/A|
65+
|RemotePowerShell|Yes|Yes|No|No|No|Yes|
66+
|REST|No|N/A|N/A|N/A|N/A|N/A|
67+
|UniversalOutlook|No|N/A|N/A|N/A|N/A|N/A|
68+
||||||||
5869

5970
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).
6071

6172
## EXAMPLES
6273

6374
### Example 1
75+
6476
```powershell
6577
New-ClientAccessRule -Name AllowRemotePS -Action Allow -AnyOfProtocols RemotePowerShell -Priority 1
6678
```
6779

6880
This example creates a highest priority rule that allows access to remote PowerShell. This rule is an important safeguard to preserve access to your organization. Without this rule, if you create rules that block your access to remote PowerShell, or that block all protocols for everyone, you'll lose the ability to fix the rules yourself (you'll need to call Microsoft Customer Service and Support).
6981

7082
### Example 2
83+
7184
```powershell
7285
New-ClientAccessRule -Name "Block ActiveSync" -Action DenyAccess -AnyOfProtocols ExchangeActiveSync -ExceptAnyOfClientIPAddressesOrRanges 192.168.10.1/24
7386
```
@@ -77,6 +90,7 @@ This example creates a new client access rule named Block ActiveSync that blocks
7790
## PARAMETERS
7891

7992
### -Action
93+
8094
The Action parameter specifies the action for the client access rule. Valid values for this parameter are AllowAccess and DenyAccess.
8195

8296
```yaml
@@ -93,6 +107,7 @@ Accept wildcard characters: False
93107
```
94108
95109
### -Name
110+
96111
The Name parameter specifies a unique name for the client access rule.
97112
98113
```yaml
@@ -109,6 +124,7 @@ Accept wildcard characters: False
109124
```
110125
111126
### -AnyOfAuthenticationTypes
127+
112128
This parameter is functional only in the cloud-based service.
113129
114130
The AnyOfAuthenticationTypes parameter specifies a condition for the client access rule that's based on the client's authentication type.
@@ -123,6 +139,8 @@ Valid values for this parameter are:
123139
124140
You can enter multiple values separated by commas. Don't use quotation marks.
125141
142+
**Note**: Please refer to the table in the beginning of this article to understand what authentication types may be used with what protocols.
143+
126144
```yaml
127145
Type: MultiValuedProperty
128146
Parameter Sets: (All)
@@ -137,6 +155,7 @@ Accept wildcard characters: False
137155
```
138156
139157
### -AnyOfClientIPAddressesOrRanges
158+
140159
The AnyOfClientIPAddressesOrRanges parameter specifies a condition for the client access rule that's based on the client's IPv4 or IPv6 address. Valid values are:
141160
142161
- Single IP address: For example, 192.168.1.1 or 2001:DB8::2AA:FF:C0A8:640A.
@@ -161,6 +180,7 @@ Accept wildcard characters: False
161180
```
162181
163182
### -AnyOfProtocols
183+
164184
The AnyOfProtocols parameter specifies a condition for the client access rule that's based on the client's protocol.
165185
166186
Valid values for this parameter are:
@@ -196,6 +216,7 @@ Accept wildcard characters: False
196216
```
197217
198218
### -AnyOfSourceTcpPortNumbers
219+
199220
This parameter is reserved for internal Microsoft use.
200221
201222
```yaml
@@ -212,6 +233,7 @@ Accept wildcard characters: False
212233
```
213234
214235
### -Confirm
236+
215237
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.
216238
217239
- 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`.
@@ -231,6 +253,7 @@ Accept wildcard characters: False
231253
```
232254

233255
### -DomainController
256+
234257
This parameter is available only in on-premises Exchange.
235258

236259
The DomainController parameter specifies the ___domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the ___domain controller by its fully qualified ___domain name (FQDN). For example, dc01.contoso.com.
@@ -249,6 +272,7 @@ Accept wildcard characters: False
249272
```
250273

251274
### -Enabled
275+
252276
The Enabled parameter specifies whether the client access rule is enabled or disabled. Valid values for this parameter are $true or $false. The default value is $true.
253277

254278
```yaml
@@ -265,6 +289,7 @@ Accept wildcard characters: False
265289
```
266290

267291
### -ExceptAnyOfAuthenticationTypes
292+
268293
This parameter is functional only in the cloud-based service.
269294

270295
The ExceptAnyOfAuthenticationTypes parameter specifies an exception for the client access rule that's based on the client's authentication type.
@@ -279,6 +304,8 @@ Valid values for this parameter are:
279304

280305
You can enter multiple values separated by commas. Don't use quotation marks.
281306

307+
**Note**: Please refer to the table in the beginning of this article to understand what authentication types may be used with what protocols.
308+
282309
```yaml
283310
Type: MultiValuedProperty
284311
Parameter Sets: (All)
@@ -293,6 +320,7 @@ Accept wildcard characters: False
293320
```
294321

295322
### -ExceptAnyOfClientIPAddressesOrRanges
323+
296324
The ExceptAnyOfClientIPAddressesOrRanges parameter specifies an exception for the client access rule that's based on the client's IPv4 or IPv6 address. Valid values are:
297325

298326
- Single IP address: For example, 192.168.1.1 or 2001:DB8::2AA:FF:C0A8:640A.
@@ -317,6 +345,7 @@ Accept wildcard characters: False
317345
```
318346

319347
### -ExceptAnyOfProtocols
348+
320349
This parameter is functional only in the cloud-based service.
321350

322351
The ExceptAnyOfProtocols parameter specifies an exception for the client access rule that's based on the client's protocol.
@@ -352,6 +381,7 @@ Accept wildcard characters: False
352381
```
353382

354383
### -ExceptAnyOfSourceTcpPortNumbers
384+
355385
This parameter is reserved for internal Microsoft use.
356386

357387
```yaml
@@ -368,6 +398,7 @@ Accept wildcard characters: False
368398
```
369399

370400
### -ExceptUserIsMemberOf
401+
371402
This parameter is reserved for internal Microsoft use.
372403

373404
```yaml
@@ -384,6 +415,7 @@ Accept wildcard characters: False
384415
```
385416

386417
### -ExceptUsernameMatchesAnyOfPatterns
418+
387419
This parameter is functional only in the cloud-based service.
388420

389421
The ExceptUsernameMatchesAnyOfPatterns parameter specifies an exception for the client access rule that's based on the user's account name in the format `<Domain>\<UserName>` (for example, `contoso.com\jeff`). This parameter accepts text and the wildcard character (\*) (for example, `*jeff*`, but not `jeff*`). Non-alphanumeric characters don't require an escape character.
@@ -404,6 +436,7 @@ Accept wildcard characters: False
404436
```
405437

406438
### -Priority
439+
407440
The Priority parameter specifies a priority value for the rule that determines the order of rule processing. A lower integer value indicates a higher priority, the value 0 is the highest priority, and rules can't have the same priority value.
408441

409442
Valid values and the default value for this parameter depend on the number of existing rules. For example, if there are 8 existing rules:
@@ -428,6 +461,7 @@ Accept wildcard characters: False
428461
```
429462

430463
### -Scope
464+
431465
The Scope parameter specifies the scope of the client access rule. Valid values are:
432466

433467
- Users: The rule only applies to end-user connections.
@@ -447,6 +481,7 @@ Accept wildcard characters: False
447481
```
448482

449483
### -UserIsMemberOf
484+
450485
This parameter is reserved for internal Microsoft use.
451486

452487
```yaml
@@ -463,6 +498,7 @@ Accept wildcard characters: False
463498
```
464499

465500
### -UsernameMatchesAnyOfPatterns
501+
466502
This parameter is functional only in the cloud-based service.
467503

468504
The UsernameMatchesAnyOfPatterns parameter specifies a condition for the client access rule that's based on the user's account name in the format `<Domain>\<UserName>` (for example, `contoso.com\jeff`). This parameter accepts text and the wildcard character (\*) (for example, `*jeff*`, but not `jeff*`). Non-alphanumeric characters don't require an escape character. This parameter does not work with the -AnyOfProtocols UniversalOutlook parameter.
@@ -483,31 +519,42 @@ Accept wildcard characters: True
483519
```
484520

485521
### -UserRecipientFilter
486-
This parameter is functional only in the cloud-based service.
487522

488-
The UserRecipientFilter parameter specifies a condition for the client access rule that uses OPath filter syntax to identify the user. The syntax is `"Property -ComparisonOperator 'Value'"` (for example, `"City -eq 'Redmond'"`).
489-
490-
- Enclose the whole OPath filter in double quotation marks " ". If the filter contains system values (for example, `$true`, `$false`, or `$null`), use single quotation marks ' ' instead. Although this parameter is a string (not a system block), you can also use braces { }, but only if the filter doesn't contain variables.
491-
- Property is a filterable property. For filterable recipient properties, see [Filterable properties for the RecipientFilter parameter on Exchange cmdlets](https://docs.microsoft.com/powershell/exchange/recipientfilter-properties).
492-
- ComparisonOperator is an OPath comparison operator (for example `-eq` for equals and `-like` for string comparison). For more information about comparison operators, see [about_Comparison_Operators](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators).
493-
- Value is the property value to search for. Enclose text values and variables in single quotation marks (`'Value'` or `'$Variable'`). If a variable value contains single quotation marks, you need to identify (escape) the single quotation marks to expand the variable correctly. For example, instead of `'$User'`, use `'$($User -Replace "'","''")'`. Don't enclose integers or system values (for example, `500`, `$true`, `$false`, or `$null`).
494-
495-
You can chain multiple search criteria together using the logical operators `-and` and `-or`. For example, `"Criteria1 -and Criteria2"` or `"(Criteria1 -and Criteria2) -or Criteria3"`.
523+
This parameter is functional only in the cloud-based service.
496524

497-
For detailed information about OPath filters in Exchange, see [Additional OPATH syntax information](https://docs.microsoft.com/powershell/exchange/recipient-filters#additional-opath-syntax-information).
525+
The UserRecipientFilter parameter specifies a condition for the client access rule that uses OPath filter syntax to identify the user based on a limited set of attributes.
498526

499-
The filterable properties that you can use with this parameter are:
527+
The filterable properties that you can use with this parameter are limited to the list below. Client Access Rules do not support the full list of recipient filters used by other features.
500528

501529
- City
502530
- Company
503-
- CountryOrRegion
531+
- CountryOrRegion (ISO 3166-1 alpha-2 code for the country must be used.)
504532
- CustomAttribute1 to CustomAttribute15
505533
- Department
506534
- Office
507535
- PostalCode
508536
- StateOrProvince
509537
- StreetAddress
510538

539+
The syntax is `"Property -ComparisonOperator 'Value'"`
540+
541+
An example would be `"City -eq 'Redmond'"`
542+
543+
Another example would be `"CountryOrRegion -eq 'SG'"`
544+
545+
- Property is one of the filterable properties in the list above (for example `City` or `CustomAttribute1`).
546+
- ComparisonOperator is an OPath comparison operator (for example `-eq` for equals and `-like` for string comparison). For more information about comparison operators, see [about_Comparison_Operators](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comparison_operators).
547+
- Value is the property value to search for. Enclose text values and variables in single quotation marks (`'Value'` or `'$Variable'`). If a variable value contains single quotation marks, you need to identify (escape) the single quotation marks to expand the variable correctly. For example, instead of `'$User'`, use `'$($User -Replace "'","''")'`. Do not enclose integers or system values (for example, `500`, `$true`, `$false`, or `$null` are all proper uses).
548+
- Enclose the whole OPath filter in double quotation marks " ". If the filter contains system values (for example, `$true`, `$false`, or `$null`), use single quotation marks ' ' instead. Although this parameter is a string (not a system block), you can also use braces { }, but only if the filter doesn't contain variables.
549+
550+
You can chain multiple search criteria together using the logical operators `-and` and `-or`.
551+
552+
An example would be, `"CustomAttribute1 -eq 'AllowOWA' -and CountryOrRegion -eq AU'"`
553+
554+
Another example would be, `"(CountryOrRegion -eq 'US' -and Department -eq 'Sales') -or Department -eq 'Research'"`.
555+
556+
For detailed information about OPath filter syntax in Exchange, see [Additional OPATH syntax information](https://docs.microsoft.com/powershell/exchange/recipient-filters#additional-opath-syntax-information).
557+
511558
```yaml
512559
Type: String
513560
Parameter Sets: (All)
@@ -522,6 +569,7 @@ Accept wildcard characters: False
522569
```
523570

524571
### -WhatIf
572+
525573
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.
526574

527575
```yaml
@@ -538,16 +586,15 @@ Accept wildcard characters: False
538586
```
539587

540588
### CommonParameters
589+
541590
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).
542591

543592
## INPUTS
544593

545-
###
546594
To see the input types that this cmdlet accepts, see [Cmdlet Input and Output Types](https://go.microsoft.com/fwlink/p/?linkId=616387). If the Input Type field for a cmdlet is blank, the cmdlet doesn't accept input data.
547595

548596
## OUTPUTS
549597

550-
###
551598
To see the return types, which are also known as output types, that this cmdlet accepts, see [Cmdlet Input and Output Types](https://go.microsoft.com/fwlink/p/?linkId=616387). If the Output Type field is blank, the cmdlet doesn't return data.
552599

553600
## NOTES

0 commit comments

Comments
 (0)