Skip to content

Commit 01b5860

Browse files
authored
Update New-ClientAccessRule.md
1 parent 3f8518b commit 01b5860

File tree

1 file changed

+34
-56
lines changed

1 file changed

+34
-56
lines changed

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

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

1414
## SYNOPSIS
15-
1615
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.
1716

1817
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.
@@ -21,7 +20,7 @@ For information about the parameter sets in the Syntax section below, see [Excha
2120

2221
## SYNTAX
2322

24-
```powershell
23+
```
2524
New-ClientAccessRule [-Name] <String> -Action <ClientAccessRulesAction>
2625
[-AnyOfAuthenticationTypes <MultiValuedProperty>]
2726
[-AnyOfClientIPAddressesOrRanges <MultiValuedProperty>]
@@ -46,41 +45,40 @@ New-ClientAccessRule [-Name] <String> -Action <ClientAccessRulesAction>
4645
```
4746

4847
## DESCRIPTION
49-
5048
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.
5149

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-
||||||||
50+
**Note**: Not all protocols support authentication type filters, and even protocols that support authentication type filters don't support all authentication types. The supported combinations are described in the following lists. Use caution when mixing protocols and authentication types in the same rule.
51+
52+
Protocols that support authentication type filters:
53+
54+
- ExchangeActiveSync: BasicAuthentication, OAuthAuthentication, and CertificateBasedAuthentication.
55+
- ExchangeAdminCenter: BasicAuthentication and AdfsAuthentication.
56+
- IMAP4: BasicAuthentication and OAuthAuthentication.
57+
- OutlookWebApp: BasicAuthentication and AdfsAuthentication.
58+
- POP3: BasicAuthentication and OAuthAuthentication.
59+
- RemotePowerShell: BasicAuthentication and NonBasicAuthentication.
60+
61+
Protcols that don't support authentication type filters:
62+
63+
- ExchangeWebServices
64+
- OfflineAddressBook
65+
- OutlookAnywhere
66+
- PowerShellWebServices
67+
- REST
68+
- UniversalOutlook
6969

7070
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).
7171

7272
## EXAMPLES
7373

7474
### Example 1
75-
7675
```powershell
7776
New-ClientAccessRule -Name AllowRemotePS -Action Allow -AnyOfProtocols RemotePowerShell -Priority 1
7877
```
7978

8079
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).
8180

8281
### Example 2
83-
8482
```powershell
8583
New-ClientAccessRule -Name "Block ActiveSync" -Action DenyAccess -AnyOfProtocols ExchangeActiveSync -ExceptAnyOfClientIPAddressesOrRanges 192.168.10.1/24
8684
```
@@ -90,7 +88,6 @@ This example creates a new client access rule named Block ActiveSync that blocks
9088
## PARAMETERS
9189

9290
### -Action
93-
9491
The Action parameter specifies the action for the client access rule. Valid values for this parameter are AllowAccess and DenyAccess.
9592

9693
```yaml
@@ -107,7 +104,6 @@ Accept wildcard characters: False
107104
```
108105
109106
### -Name
110-
111107
The Name parameter specifies a unique name for the client access rule.
112108
113109
```yaml
@@ -124,7 +120,6 @@ Accept wildcard characters: False
124120
```
125121
126122
### -AnyOfAuthenticationTypes
127-
128123
This parameter is functional only in the cloud-based service.
129124
130125
The AnyOfAuthenticationTypes parameter specifies a condition for the client access rule that's based on the client's authentication type.
@@ -155,7 +150,6 @@ Accept wildcard characters: False
155150
```
156151
157152
### -AnyOfClientIPAddressesOrRanges
158-
159153
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:
160154
161155
- Single IP address: For example, 192.168.1.1 or 2001:DB8::2AA:FF:C0A8:640A.
@@ -180,7 +174,6 @@ Accept wildcard characters: False
180174
```
181175
182176
### -AnyOfProtocols
183-
184177
The AnyOfProtocols parameter specifies a condition for the client access rule that's based on the client's protocol.
185178
186179
Valid values for this parameter are:
@@ -216,7 +209,6 @@ Accept wildcard characters: False
216209
```
217210
218211
### -AnyOfSourceTcpPortNumbers
219-
220212
This parameter is reserved for internal Microsoft use.
221213
222214
```yaml
@@ -233,7 +225,6 @@ Accept wildcard characters: False
233225
```
234226
235227
### -Confirm
236-
237228
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.
238229
239230
- 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`.
@@ -253,7 +244,6 @@ Accept wildcard characters: False
253244
```
254245

255246
### -DomainController
256-
257247
This parameter is available only in on-premises Exchange.
258248

259249
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.
@@ -272,7 +262,6 @@ Accept wildcard characters: False
272262
```
273263

274264
### -Enabled
275-
276265
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.
277266

278267
```yaml
@@ -289,7 +278,6 @@ Accept wildcard characters: False
289278
```
290279

291280
### -ExceptAnyOfAuthenticationTypes
292-
293281
This parameter is functional only in the cloud-based service.
294282

295283
The ExceptAnyOfAuthenticationTypes parameter specifies an exception for the client access rule that's based on the client's authentication type.
@@ -320,7 +308,6 @@ Accept wildcard characters: False
320308
```
321309

322310
### -ExceptAnyOfClientIPAddressesOrRanges
323-
324311
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:
325312

326313
- Single IP address: For example, 192.168.1.1 or 2001:DB8::2AA:FF:C0A8:640A.
@@ -345,7 +332,6 @@ Accept wildcard characters: False
345332
```
346333

347334
### -ExceptAnyOfProtocols
348-
349335
This parameter is functional only in the cloud-based service.
350336

351337
The ExceptAnyOfProtocols parameter specifies an exception for the client access rule that's based on the client's protocol.
@@ -381,7 +367,6 @@ Accept wildcard characters: False
381367
```
382368

383369
### -ExceptAnyOfSourceTcpPortNumbers
384-
385370
This parameter is reserved for internal Microsoft use.
386371

387372
```yaml
@@ -398,7 +383,6 @@ Accept wildcard characters: False
398383
```
399384

400385
### -ExceptUserIsMemberOf
401-
402386
This parameter is reserved for internal Microsoft use.
403387

404388
```yaml
@@ -415,7 +399,6 @@ Accept wildcard characters: False
415399
```
416400

417401
### -ExceptUsernameMatchesAnyOfPatterns
418-
419402
This parameter is functional only in the cloud-based service.
420403

421404
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.
@@ -436,7 +419,6 @@ Accept wildcard characters: False
436419
```
437420

438421
### -Priority
439-
440422
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.
441423

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

463445
### -Scope
464-
465446
The Scope parameter specifies the scope of the client access rule. Valid values are:
466447

467448
- Users: The rule only applies to end-user connections.
@@ -481,7 +462,6 @@ Accept wildcard characters: False
481462
```
482463

483464
### -UserIsMemberOf
484-
485465
This parameter is reserved for internal Microsoft use.
486466

487467
```yaml
@@ -498,7 +478,6 @@ Accept wildcard characters: False
498478
```
499479

500480
### -UsernameMatchesAnyOfPatterns
501-
502481
This parameter is functional only in the cloud-based service.
503482

504483
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.
@@ -519,39 +498,38 @@ Accept wildcard characters: True
519498
```
520499

521500
### -UserRecipientFilter
522-
523501
This parameter is functional only in the cloud-based service.
524502

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.
503+
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 recipient properties. Client Access Rules don't support the full list of available recipient properties.
526504

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.
505+
You can use the following properties with this parameter:
528506

529507
- City
530508
- Company
531-
- CountryOrRegion (ISO 3166-1 alpha-2 code for the country must be used.)
509+
- CountryOrRegion (ISO 3166-1 alpha-2 country code.)
532510
- CustomAttribute1 to CustomAttribute15
533511
- Department
534512
- Office
535513
- PostalCode
536514
- StateOrProvince
537515
- StreetAddress
538516

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'"`
517+
The basic syntax for this parameter is `"Property -ComparisonOperator 'Value'"`:
544518

545519
- Property is one of the filterable properties in the list above (for example `City` or `CustomAttribute1`).
546520
- 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).
521+
- 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 in quotation marks (for example, use `500`, `$true`, `$false`, or `$null` instead).
548522
- 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.
549523

550-
You can chain multiple search criteria together using the logical operators `-and` and `-or`.
524+
For example:
525+
526+
- `"City -eq 'Redmond'"`
527+
- `"CountryOrRegion -eq 'SG'"`.
551528

552-
An example would be, `"CustomAttribute1 -eq 'AllowOWA' -and CountryOrRegion -eq AU'"`
529+
You can chain multiple search criteria together using the logical operators `-and` and `-or`. For example:
553530

554-
Another example would be, `"(CountryOrRegion -eq 'US' -and Department -eq 'Sales') -or Department -eq 'Research'"`.
531+
- `"CustomAttribute1 -eq 'AllowOWA' -and CountryOrRegion -eq AU'"`
532+
- `"(CountryOrRegion -eq 'US' -and Department -eq 'Sales') -or Department -eq 'Research'"`.
555533

556534
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).
557535

@@ -569,7 +547,6 @@ Accept wildcard characters: False
569547
```
570548

571549
### -WhatIf
572-
573550
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.
574551

575552
```yaml
@@ -586,15 +563,16 @@ Accept wildcard characters: False
586563
```
587564

588565
### CommonParameters
589-
590566
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).
591567

592568
## INPUTS
593569

570+
###
594571
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.
595572

596573
## OUTPUTS
597574

575+
###
598576
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.
599577

600578
## NOTES

0 commit comments

Comments
 (0)