You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/disable-access-to-exchange-online-powershell.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: "Enable or disable access to Exchange Online PowerShell"
3
3
ms.author: chrisda
4
4
author: chrisda
5
5
manager: deniseb
6
-
ms.date: 5/16/2024
6
+
ms.date: 12/11/2024
7
7
ms.audience: Admin
8
8
audience: Admin
9
9
ms.topic: article
@@ -18,7 +18,7 @@ description: "Admins can learn how to disable or enable access to Exchange Onlin
18
18
19
19
Exchange Online PowerShell is the administrative interface that enables admins to manage the Exchange Online part of a Microsoft 365 organization from the command line (including many security features in Exchange Online Protection and Microsoft Defender for Office 365).
20
20
21
-
By default, all accounts in Microsoft 365 are allowed to use Exchange Online PowerShell. This access doesn't give users administrative capabilities in an organization. They're still limited by [role based access control (RBAC)](/exchange/permissions-exo/permissions-exo) (for example, they can configure settings on their own mailbox or manage distribution groups that they own, but not much else).
21
+
By default, all accounts in Microsoft 365 are allowed to use Exchange Online PowerShell. This access doesn't give users administrative capabilities. They're still limited by [role based access control (RBAC)](/exchange/permissions-exo/permissions-exo). For example, they can configure some settings on their own mailbox and manage distribution groups that they own, but not much else.
22
22
23
23
Admins can use the procedures in this article to disable or enable a user's ability to connect to Exchange Online PowerShell.
24
24
@@ -33,7 +33,7 @@ Admins can use the procedures in this article to disable or enable a user's abil
33
33
-[Microsoft Entra RBAC](/microsoft-365/admin/add-users/about-admin-roles): Membership in the **Exchange Administrator** or **Global Administrator**<sup>\*</sup> roles gives users the required permissions *and* permissions for other features in Microsoft 365.
34
34
35
35
> [!IMPORTANT]
36
-
> In your haste to quickly and globally disable PowerShell access in your cloud-based organization, beware of commands like `Get-User | Set-User -EXOModuleEnabled $false` without considering admin accounts. Use the procedures in this article to selectively remove PowerShell access, or preserve access for those who need it by using the following syntax in your global removal command: `Get-User | Where-Object {$_.UserPrincipalName -ne '[email protected]' -and $_.UserPrincipalName -ne '[email protected]'...} | Set-User -EXOModuleEnabled $false`.
36
+
> In your haste to quickly and globally disable PowerShell access in your cloud-based organization, beware of commands like `Get-User | Set-User -EXOModuleEnabled $false` without considering admin accounts. Use the procedures in this article to **selectively** remove PowerShell access, or **preserve access for those who need it** by using the following syntax in your global removal command: `Get-User | Where-Object {$_.UserPrincipalName -ne '[email protected]' -and $_.UserPrincipalName -ne '[email protected]'...} | Set-User -EXOModuleEnabled $false`.
37
37
>
38
38
> If you accidentally lock yourself out of PowerShell access, create a new admin account in the Microsoft 365 admin center, and then use that account to give yourself PowerShell access using the procedures in this article.
To prevent access to Exchange Online PowerShell for a specific group of existing users, you have the following options:
64
64
65
-
-**Filter users based on an existing attribute**: This method assumes that the target user accounts all share a unique filterable attribute. Some attributes, such as Title, Department, address information, and telephone number, are available only from the **Get-User** cmdlet. Other attributes, such as CustomAttribute1 to CustomAttribute15, are available only from the **Get-Mailbox** cmdlet.
65
+
-**Filter users based on an existing attribute**: This method assumes that the target user accounts all share a unique filterable attribute. Some attributes (for example, Title, Department, address information, and telephone number) are available only from the **Get-User** cmdlet. Other attributes (for example, CustomAttribute1 to CustomAttribute15) are available only from the **Get-Mailbox** cmdlet.
66
66
-**Use a list of specific users**: After you generate the list of specific users, you can use that list to disable their access to Exchange Online PowerShell.
## View the Exchange Online PowerShell access status for users
109
109
110
+
> [!TIP]
111
+
> The newer `EXOModuleEnabled` property isn't available to use with the *Filter* parameter on the **Get-User** cmdlet, but the values of the `EXOModuleEnabled` property and the older `RemotePowerShellEnabled` property are always the same, so use the `RemotePowerShellEnabled` property with the *Filter* parameter on the **Get-User** cmdlet.
112
+
110
113
To view the PowerShell access status for a specific user, replace \<UserIdentity\> with the name or user principal name (UPN) of the user, and run the following command:
This example adds a policy for the `<cateogry_id>` category in Viva. The policy disables the category (effectively all features under the category) for all users in the organization.
112
+
This example adds a policy for the `<category_id>` category in Viva. The policy disables the category (effectively all features under the category) for all users in the organization.
This example adds a policy for the `<cateogry_id>` category in Viva. The policy disables the category (effectively all features under the category) for all users in the specified groups.
119
+
This example adds a policy for the `<category_id>` category in Viva. The policy disables the category (effectively all features under the category) for all users in the specified groups.
This example adds a policy for the `<cateogry_id>` category in Viva. The policy disables the category (effectively all features under the category) for the specified users.
126
+
This example adds a policy for the `<category_id>` category in Viva. The policy disables the category (effectively all features under the category) for the specified users.
This example adds a policy for the `<cateogry_id>` category in Viva. The policy disables the category (effectively all features under the category) for the specified users and group members.
133
+
This example adds a policy for the `<category_id>` category in Viva. The policy disables the category (effectively all features under the category) for the specified users and group members.
This example adds a policy for the `<cateogry_id>` category in Viva where the policy name is with spaces. The policy disables the category (effectively all features under the category) for all users in the organization.
140
+
This example adds a policy for the `<category_id>` category in Viva where the policy name is with spaces. The policy disables the category (effectively all features under the category) for all users in the organization.
@@ -42,6 +41,14 @@ The output of this cmdlet contains the following information:
42
41
- RecordsReturned: The number of records returned in the query.
43
42
- PageCookie: Used to get the next set of records when MorePagesAvailable is True.
44
43
44
+
The following list describes best practices for scripts using this cmdlet:
45
+
46
+
- We recommend not using a single script to export multiple SITs/Labels. Instead, create a script for one SIT/Label, and then re-use the same script for each SIT/Label in each workload as required.
47
+
- When retrying the script, make sure to reconnect to the session first. The session's token expires after about an hour, which can cause the cmdlet to fail. To fix this issue, reconnect to the session before retrying the script. If the script fails, restart it using the last page cookie returned to continue the export from where it left off.
48
+
49
+
> [!TIP]
50
+
> To support unattended scripts that run for a long time, you can use [certificate-based authentication (CBA)](https://learn.microsoft.com/powershell/exchange/app-only-auth-powershell-v2).
51
+
45
52
To use this cmdlet in Security & Compliance PowerShell, you need to be assigned permissions. For more information, see [Permissions in the Microsoft Purview compliance portal](https://learn.microsoft.com/purview/microsoft-365-compliance-center-permissions).
46
53
47
54
## EXAMPLES
@@ -69,6 +76,51 @@ This example exports records for the specified sensitive info type for all workl
69
76
70
77
## PARAMETERS
71
78
79
+
### -TagType
80
+
The TagType parameter specifies the type of label to export file details from. Valid values are:
81
+
82
+
- Retention
83
+
- SensitiveInformationType
84
+
- Sensitivity
85
+
- TrainableClassifier
86
+
87
+
```yaml
88
+
Type: String
89
+
Parameter Sets: (All)
90
+
Aliases:
91
+
Applicable: Security & Compliance
92
+
93
+
Required: True
94
+
Position: 5
95
+
Default value: None
96
+
Accept pipeline input: False
97
+
Accept wildcard characters: False
98
+
```
99
+
100
+
### -Aggregate
101
+
The Aggregate parameter switch returns the folder level aggregated numbers instead of returning details at the item level. You don't need to specify a value with this switch.
102
+
103
+
Using this switch significantly reduces the export time. To download the items in a folder, run this cmdlet for specific folders.
104
+
105
+
When you use this switch with the TagName, TagType and Workload parameters, the command returns the following information:
106
+
107
+
- SiteUlrs: OneDrive and SharePoint.
108
+
- UPNs: Exchange Online and Teams.
109
+
- The count of items stamped with that tag.
110
+
111
+
```yaml
112
+
Type: SwitchParameter
113
+
Parameter Sets: (All)
114
+
Aliases:
115
+
Applicable: Security & Compliance
116
+
117
+
Required: False
118
+
Position: Named
119
+
Default value: False
120
+
Accept pipeline input: False
121
+
Accept wildcard characters: False
122
+
```
123
+
72
124
### -PageCookie
73
125
The PageCookie parameter specifies whether to get more data when the value of the MorePagesAvailable property in the command output is True. If you don't use the PageSize parameter, a maximum of 100 records are returned. If you use the PageSize parameter, a maximum of 10000 records can be returned.
The PageSize parameter specifies the maximum number of records to return in a single query. Valid input for this parameter is an integer between 1 and 10000. The default value is 100.
90
142
143
+
**Note**: In empty folders or folders with few files, this parameter can cause the command to run for a long time as it tries to get the PageSize count of the results. To prevent this issue, the command returns data from 5 folders or the number of records specified by the PageSize parameter, whichever completes first. For example, if there are 10 folders with 1 record each, the command returns 5 records of the top 5 folders. In the next execution using page cookie, it returns 5 records from the remaining 5 folders, even if the PageSize value is 10.
144
+
91
145
```yaml
92
146
Type: Int32
93
147
Parameter Sets: (All)
@@ -135,27 +189,6 @@ Accept pipeline input: False
135
189
Accept wildcard characters: False
136
190
```
137
191
138
-
### -TagType
139
-
The TagType parameter specifies the type of label to export file details from. Valid values are:
140
-
141
-
- Retention
142
-
- SensitiveInformationType
143
-
- Sensitivity
144
-
- TrainableClassifier
145
-
146
-
```yaml
147
-
Type: String
148
-
Parameter Sets: (All)
149
-
Aliases:
150
-
Applicable: Security & Compliance
151
-
152
-
Required: True
153
-
Position: 5
154
-
Default value: None
155
-
Accept pipeline input: False
156
-
Accept wildcard characters: False
157
-
```
158
-
159
192
### -UserPrincipalName
160
193
The UserPrincipalName parameter specifies the user account in UPN format to export message details from. An example UPN value is [email protected].
Copy file name to clipboardExpand all lines: exchange/exchange-ps/exchange/Get-App.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ The Mailbox parameter specifies the identity of the mailbox where the apps are i
109
109
110
110
You can't use this parameter with the Identity parameter.
111
111
112
-
Note: This parameter only returns user installed and default add-ins. It doesn't return add-ins installed by admins from Integrated Apps. For more information, see [Deploy and manage Office Add-ins](https://learn.microsoft.com/microsoft-365/admin/manage/office-addins).
112
+
**Note**: This parameter only returns user installed and default add-ins. It doesn't return add-ins installed by admins from Integrated Apps. For more information, see [Deploy and manage Office Add-ins](https://learn.microsoft.com/microsoft-365/admin/manage/office-addins).
In Exchange Online, this example specifies whether legacy Exchange tokens for Outlook add-ins are allowed in the organization.
54
+
47
55
## PARAMETERS
48
56
49
57
### -Identity
@@ -66,6 +74,31 @@ Accept pipeline input: False
66
74
Accept wildcard characters: False
67
75
```
68
76
77
+
### -AllowLegacyExchangeTokens
78
+
This parameter is available only in the cloud-based service.
79
+
80
+
The AllowLegacyExchangeTokens switch specifies whether legacy Exchange tokens are allowed for Outlook add-ins in your organization. You don't need to specify a value with this switch.
81
+
82
+
Legacy Exchange tokens include Exchange user identity and callback tokens.
83
+
84
+
**Important**:
85
+
86
+
- Currently, the AllowLegacyExchangeTokens switch only specifies whether legacy Exchange tokens are allowed in your organization. For now, disregard the empty Allowed and Blocked arrays returned by the switch.
87
+
- Legacy Exchange tokens will eventually be blocked by default in all cloud-based organizations. For more information, see [Nested app authentication and Outlook legacy tokens deprecation FAQ](https://learn.microsoft.com/office/dev/add-ins/outlook/faq-nested-app-auth-outlook-legacy-tokens#what-is-the-timeline-for-shutting-down-legacy-exchange-online-tokens).
Copy file name to clipboardExpand all lines: exchange/exchange-ps/exchange/Get-ClientAccessRule.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ ms.reviewer:
13
13
14
14
## SYNOPSIS
15
15
> [!NOTE]
16
-
> Beginning in October 2022, we've disabled access to client access rules for all existing Exchange Online organizations that weren't using them. In September 2024, support for client access rules will end for all Exchange Online organizations. For more information, see [Update: Deprecation of Client Access Rules in Exchange Online](https://techcommunity.microsoft.com/t5/exchange-team-blog/update-deprecation-of-client-access-rules-in-exchange-online/ba-p/3790165).
16
+
> Beginning in October 2022, client access rules were deprecated for all Exchange Online organizations that weren't using them. Client access rules will be deprecated for all remaining organizations on September 1, 2025. If you choose to turn off client access rules before the deadline, the feature will be disabled in your organization. For more information, see [Update on Client Access Rules Deprecation in Exchange Online](https://techcommunity.microsoft.com/blog/exchange/update-on-client-access-rules-deprecation-in-exchange-online/4354809).
17
17
18
18
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.
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).
0 commit comments