Skip to content

Commit e64947d

Browse files
authored
Merge pull request MicrosoftDocs#12417 from MicrosoftDocs/chrisda
Update disable-access-to-exchange-online-powershell.md
2 parents 63db996 + ae5db33 commit e64947d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

exchange/docs-conceptual/disable-access-to-exchange-online-powershell.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: "Enable or disable access to Exchange Online PowerShell"
33
ms.author: chrisda
44
author: chrisda
55
manager: deniseb
6-
ms.date: 5/16/2024
6+
ms.date: 12/11/2024
77
ms.audience: Admin
88
audience: Admin
99
ms.topic: article
@@ -18,7 +18,7 @@ description: "Admins can learn how to disable or enable access to Exchange Onlin
1818

1919
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).
2020

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.
2222

2323
Admins can use the procedures in this article to disable or enable a user's ability to connect to Exchange Online PowerShell.
2424

@@ -33,7 +33,7 @@ Admins can use the procedures in this article to disable or enable a user's abil
3333
- [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.
3434

3535
> [!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`.
3737
>
3838
> 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.
3939
>
@@ -62,7 +62,7 @@ Set-User -Identity [email protected] -EXOModuleEnabled $true
6262

6363
To prevent access to Exchange Online PowerShell for a specific group of existing users, you have the following options:
6464

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.
6666
- **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.
6767

6868
### Filter users based on an existing attribute
@@ -107,6 +107,9 @@ $NoPS | foreach {Set-User -Identity $_ -EXOModuleEnabled $false}
107107

108108
## View the Exchange Online PowerShell access status for users
109109

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+
110113
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:
111114

112115
```powershell
@@ -122,11 +125,11 @@ Get-User -ResultSize unlimited | Format-Table -Auto DisplayName,EXOModuleEnabled
122125
To display all users who don't have access to Exchange Online PowerShell, run the following command:
123126

124127
```powershell
125-
Get-User -ResultSize unlimited -Filter 'EXOModuleEnabled -eq $false'
128+
Get-User -ResultSize unlimited -Filter 'RemotePowerShellEnabled -eq $false'
126129
```
127130

128131
To display all users who have access to Exchange Online PowerShell, run the following command:
129132

130133
```powershell
131-
Get-User -ResultSize unlimited -Filter 'EXOModuleEnabled -eq $true'
134+
Get-User -ResultSize unlimited -Filter 'RemotePowerShellEnabled -eq $true'
132135
```

0 commit comments

Comments
 (0)