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:
The RemotePowerShellEnabled parameter specifies whether the user can connect to Exchange using remote PowerShell. Remote PowerShell is required to open the Exchange Management Shell on Exchange servers, or to use Windows PowerShell open and import a remote PowerShell session to Exchange. Access to remote PowerShell is required even if you're trying to open the Exchange Management Shell on the local Exchange server. Valid values are:
741
+
The RemotePowerShellEnabled parameter specifies whether the user has access to Exchange PowerShell. Valid values are:
742
742
743
-
- $true: The user can use remote PowerShell. This is the default value.
744
-
- $false: The user can't use remote PowerShell.
743
+
- $true: The user has access to Exchange Online PowerShell, the Exchange Management Shell, and the Exchange admin center (EAC). This is the default value.
744
+
- $false: The user has doesn't have access to Exchange Online PowerShell, the Exchange Management Shell, or the EAC.
745
+
746
+
Access to Exchange PowerShell is required even if you're trying to open the Exchange Management Shell or the EAC on the local Exchange server.
747
+
748
+
A user's experience in any of these management interfaces is still controlled by the role-based access control (RBAC) permissions that are assigned to them.
The RemotePowerShellEnabled parameter specifies whether the user has access to remote PowerShell. Valid values are:
1910
+
The RemotePowerShellEnabled parameter specifies whether the user has access to Exchange PowerShell. Valid values are:
1911
1911
1912
1912
- $true: The user has access to Exchange Online PowerShell, the Exchange Management Shell, and the Exchange admin center (EAC). This is the default value.
1913
1913
- $false: The user has doesn't have access to Exchange Online PowerShell, the Exchange Management Shell, or the EAC.
1914
1914
1915
-
Access to remote PowerShell is required even if you're trying to open the Exchange Management Shell or the EAC on the local Exchange server.
1915
+
Access to Exchange PowerShell is required even if you're trying to open the Exchange Management Shell or the EAC on the local Exchange server.
1916
1916
1917
1917
A user's experience in any of these management interfaces is still controlled by the role-based access control (RBAC) permissions that are assigned to them.
The RemotePowerShellEnabled parameter specifies whether the user can connect to Exchange using remote PowerShell. Remote PowerShell is required to open the Exchange Management Shell on Exchange servers, or to use Windows PowerShell open and import a remote PowerShell session to Exchange. Access to remote PowerShell is required even if you're trying to open the Exchange Management Shell on the local Exchange server. Valid values are:
625
+
The RemotePowerShellEnabled parameter specifies whether the user has access to Exchange PowerShell. Valid values are:
626
626
627
-
- $true: The user can use remote PowerShell. This is the default value.
628
-
- $false: The user can't use remote PowerShell.
627
+
- $true: The user has access to Exchange Online PowerShell, the Exchange Management Shell, and the Exchange admin center (EAC). This is the default value.
628
+
- $false: The user has doesn't have access to Exchange Online PowerShell, the Exchange Management Shell, or the EAC.
629
+
630
+
Access to Exchange PowerShell is required even if you're trying to open the Exchange Management Shell or the EAC on the local Exchange server.
631
+
632
+
A user's experience in any of these management interfaces is still controlled by the role-based access control (RBAC) permissions that are assigned to them.
**Note**: This parameter is being deprecated in cloud-based environments. In cloud-based environments, use the EXOModuleEnabled parameter instead.
1020
+
**Note**: In cloud-based environments, this parameter is being deprecated, so use the EXOModuleEnabled parameter instead.
1021
1021
1022
-
The RemotePowerShellEnabled parameter specifies whether the user has access to remote PowerShell. Remote PowerShell access is required to open the Exchange Management Shell or the Exchange admin center (EAC), even if you're trying to open the Exchange Management Shell or the EAC on the local Mailbox server. Valid values are:
1022
+
The RemotePowerShellEnabled parameter specifies whether the user has access to Exchange PowerShell. Valid values are:
1023
1023
1024
-
- $true: The user has access to remote PowerShell.
1025
-
- $false: The user doesn't have access to remote PowerShell.
1024
+
- $true: The user has access to Exchange Online PowerShell, the Exchange Management Shell, and the Exchange admin center (EAC).
1025
+
- $false: The user has doesn't have access to Exchange Online PowerShell, the Exchange Management Shell, or the EAC.
1026
1026
1027
1027
The default value depends on the management roles that are assigned to the user.
1028
1028
1029
+
Access to Exchange PowerShell is required even if you're trying to open the Exchange Management Shell or the EAC on the local Exchange server.
1030
+
1031
+
A user's experience in any of these management interfaces is still controlled by the role-based access control (RBAC) permissions that are assigned to them.
0 commit comments