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
+19-20Lines changed: 19 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
title: "Enable or disable access to Exchange Online PowerShell"
3
3
ms.author: chrisda
4
4
author: chrisda
5
-
manager: dansimp
6
-
ms.date: 9/1/2023
5
+
manager: deniseb
6
+
ms.date: 5/16/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).
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).
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
@@ -30,10 +30,10 @@ Admins can use the procedures in this article to disable or enable a user's abil
30
30
31
31
- You need to be assigned permissions before you can do the procedures in this article. You have the following options:
32
32
-[Exchange Online RBAC](/exchange/permissions-exo/permissions-exo): Membership in the **Organization Management** or **Recipient Management** role groups.
33
-
-[Microsoft Entra RBAC](/microsoft-365/admin/add-users/about-admin-roles): Membership in the **Global Administrator** role.
33
+
-[Microsoft Entra RBAC](/microsoft-365/admin/add-users/about-admin-roles): Membership in the **Global Administrator** role 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 organization, beware of commands like `Get-User | Set-User -RemotePowerShellEnabled $false` without considering admin accounts. Use the procedures in this article to selectively remove remote 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 -RemotePowerShellEnabled $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.
39
39
@@ -44,24 +44,23 @@ Admins can use the procedures in this article to disable or enable a user's abil
44
44
45
45
## Enable or disable access to Exchange Online PowerShell for a user
46
46
47
-
This example disables access to Exchange Online PowerShell for the user [email protected].
47
+
This example disables access to Exchange Online PowerShell for the user `[email protected]`.
## Disable access to Exchange Online PowerShell for many users
60
60
61
61
To prevent access to Exchange Online PowerShell for a specific group of existing users, you have the following options:
62
62
63
-
-**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 visible only when you use the **Get-User** cmdlet. Other attributes, such as CustomAttribute1-15, are visible only when you use the **Get-Mailbox** cmdlet.
64
-
63
+
-**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
64
-**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.
66
65
67
66
### Filter users based on an existing attribute
@@ -71,15 +70,15 @@ To disable access to Exchange Online PowerShell for any number of users based on
The following example uses the text file C:\My Documents\NoPowerShell.txt to identify the users by their accounts. The text file must contain one account on each line as follows:
## View the Exchange Online PowerShell access status for users
108
107
109
108
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:
0 commit comments