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/app-only-auth-powershell-v2.md
+30-13Lines changed: 30 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: App-only authentication in Exchange Online PowerShell and Security & Comp
3
3
ms.author: chrisda
4
4
author: chrisda
5
5
manager: dansimp
6
-
ms.date: 01/31/2023
6
+
ms.date: 4/20/2023
7
7
ms.audience: Admin
8
8
audience: Admin
9
9
ms.topic: article
@@ -44,10 +44,6 @@ Certificate based authentication (CBA) or app-only authentication as described i
44
44
>
45
45
> You can use Microsoft Graph to replace most of the functionality from those cmdlets. For more information, see [Working with groups in Microsoft Graph](/graph/api/resources/groups-overview).
46
46
>
47
-
> - In Security & Compliance PowerShell, you can't use the procedures in this article with the following cmdlets:
> - Delegated scenarios are supported in Exchange Online. The recommended method for connecting with delegation is using GDAP and App Consent. For more information, see [Use the Exchange Online PowerShell v3 Module with GDAP and App Consent](/powershell/partnercenter/exchange-online-gdap-app). You can also use multi-tenant applications when CSP relationships are not created with the customer. The required steps for using multi-tenant applications are called out within the regular instructions in this article.
52
48
>
53
49
> - If the procedures in this article don't work for you, verify that you don't have Beta versions of the PackageManagement or PowerShellGet modules installed by running the following command: `Get-InstalledModule PackageManagement -AllVersions; Get-InstalledModule PowerShellGet -AllVersions`.
@@ -166,7 +162,7 @@ For a detailed visual flow about creating applications in Azure AD, see <https:/
166
162
167
163

168
164
169
-
Or, to go directly to the **App registrations** page, use <https://portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/~/RegisteredApps>.
165
+
Or, to go directly to the **App registrations** page, use <https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade>.
170
166
171
167
3. On the **App registrations** page, click **New registration**.
172
168
@@ -219,6 +215,25 @@ For a detailed visual flow about creating applications in Azure AD, see <https:/
219
215
],
220
216
```
221
217
218
+
> [!NOTE]
219
+
> Microsoft 365 GCC High or DoD environments have access to Security & Compliance PowerShell only. Use the following values for `resourceAppId`, `resourceAccess id`, and `resourceAccess type`:
3. Still on the **Manifest** page, under **Management**, select **API permissions**.
@@ -314,7 +329,7 @@ For more information about the URL syntax, see [Request the permissions from a d
314
329
You have two options:
315
330
316
331
-**Assign Azure AD roles to the application**: This method is supported in Exchange Online PowerShell and Security & Compliance PowerShell.
317
-
-**Assign custom Exchange Online role groups to the application**: Currently, this method is supported only in Exchange Online PowerShell, and only when you connect in [REST API mode](exchange-online-powershell-v2.md#updates-for-the-exo-v3-module) (don't use the _UseRPSSession_ switch in the **Connect-ExchangeOnline** command).
332
+
-**Assign custom Exchange Online role groups to the application using service principals**: Currently, this method is supported only in Exchange Online PowerShell, and only when you connect in [REST API mode](exchange-online-powershell-v2.md#updates-for-the-exo-v3-module) (don't use the _UseRPSSession_ switch in the **Connect-ExchangeOnline** command).
318
333
319
334
> [!NOTE]
320
335
> You can also combine both methods to assign permissions. For example, you can use Azure AD roles for the "Exchange Recipient Administrator" role and also assign your custom RBAC role to extend the permissions.
@@ -390,14 +405,16 @@ For general instructions about assigning roles in Azure AD, see [View and assign
390
405
391
406

392
407
393
-
#### Assign custom Exchange Online role groups to the application
408
+
#### Assign custom Exchange Online role groups to the application using service principals
394
409
395
410
> [!NOTE]
396
-
> Remember, this method is supported only in Exchange Online PowerShell, and only when you connect in [REST API mode](exchange-online-powershell-v2.md#updates-for-the-exo-v3-module) (don't use the _UseRPSSession_ switch in the **Connect-ExchangeOnline** command).
411
+
> You need to connect to Exchange Online PowerShell or Security & Compliance PowerShell _before_ completing steps to create a new service principal. Creating a new service principal without connecting to PowerShell won't work (your Azure App ID and Object ID is needed to create the new service principal).
412
+
>
413
+
> This method is supported only in Exchange Online PowerShell, and only when you connect in [REST API mode](exchange-online-powershell-v2.md#updates-for-the-exo-v3-module) (don't use the _UseRPSSession_ switch in the **Connect-ExchangeOnline** command).
397
414
398
415
For information about creating custom role groups, see [Create role groups](/exchange/permissions-exo/role-groups#create-role-groups). The custom role group that you assign to the application can contain any combination of built-in and custom roles.
399
416
400
-
To assign custom Exchange Online role groups to the application, do the following steps:
417
+
To assign custom role groups to the application using service principals, do the following steps:
401
418
402
419
1. In [Azure Active Directory PowerShell for Graph](/powershell/azure/active-directory/install-adv2), run the following command to store the details of the Azure application that you registered in [Step 1](#step-1-register-the-application-in-azure-ad) in a variable:
403
420
@@ -413,8 +430,8 @@ To assign custom Exchange Online role groups to the application, do the followin
413
430
414
431
For detailed syntax and parameter information, see [Get-AzureADServicePrincipal](/powershell/module/azuread/get-azureadserviceprincipal).
415
432
416
-
2. In the same PowerShell window, connect to [Exchange Online PowerShell](connect-to-exchange-online-powershell.md) and run the following commands to:
417
-
- Create an Exchange Online service principal object for the Azure application.
433
+
2. In the same PowerShell window, connect to [Exchange Online PowerShell](connect-to-exchange-online-powershell.md)or [Security & Compliance PowerShell](connect-to-scc-powershell.md)and run the following commands to:
434
+
- Create a service principal object for the Azure application.
418
435
- Store the details of the service principal in a variable.
419
436
420
437
```powershell
@@ -433,7 +450,7 @@ To assign custom Exchange Online role groups to the application, do the followin
433
450
434
451
For detailed syntax and parameter information, see [New-ServicePrincipal](/powershell/module/exchange/new-serviceprincipal).
435
452
436
-
3. In Exchange Online PowerShell, run the following command to add the service principal as a member of the custom role group:
453
+
3. In Exchange Online PowerShell or Security & Compliance PowerShell, run the following command to add the service principal as a member of the custom role group:
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/connect-to-exchange-online-powershell.md
+13-1Lines changed: 13 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,7 @@ The connection examples in the following sections use modern authentication, and
165
165
2. On any other device with a web browser and internet access, open <https://microsoft.com/devicelogin> and enter the \<XXXXXXXXX\> code value from the previous step.
166
166
167
167
3. Enter your credentials on the resulting pages.
168
-
168
+
169
169
4. In the confirmation prompt, click **Continue**. The next message should indicate success, and you can close the browser or tab.
170
170
171
171
5. The command from step 1 continues to connect you to Exchange Online PowerShell.
@@ -240,6 +240,18 @@ If you receive errors, check the following requirements:
240
240
241
241
- If your organization uses federated authentication, and your identity provider (IDP) and/or security token service (STS) isn't publicly available, you can't use a federated account to connect to Exchange Online PowerShell. Instead, create and use a non-federated account in Microsoft 365 to connect to Exchange Online PowerShell.
242
242
243
+
- REST-based connections to Exchange Online PowerShell require the PowerShellGet module, and by dependency, the PackageManagement module, so you'll receive errors if you try to connect without having them installed. For example, you might see the following error:
244
+
245
+
> The term 'Update-ModuleManifest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
246
+
247
+
For more information about the PowerShellGet and PackageManagement module requirements, see [PowerShellGet for REST-based connections in Windows](exchange-online-powershell-v2.md#powershellget-for-rest-based-connections-in-windows).
248
+
249
+
- After you connect, you might received an error that looks like this:
250
+
251
+
> Could not load file or assembly 'System.IdentityModel.Tokens.Jwt,Version=\<Version\>, Culture=neutral, PublicKeyToken=\<TokenValue\>'. Could not find or load a specific file.
252
+
253
+
This error happens when the Exchange Online PowerShell module conflicts with another module that's imported into the runspace. Try connecting in a new Windows PowerShell window before importing other modules.
254
+
243
255
## Appendix: Comparison of old and new connection methods
244
256
245
257
This section attempts to compare older connection methods that have been replaced by the Exchange Online PowerShell module. The Basic authentication and OAuth token procedures are included for historical reference only and are no longer supported.
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/connect-to-exchange-online-protection-powershell.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
@@ -28,7 +28,7 @@ For more information about Exchange Online Protection PowerShell, see [Exchange
28
28
> Version 2.0.5 and earlier is known as the Exchange Online PowerShell V2 module (abbreviated as the EXO V2 module). Version 3.0.0 and later is known as the Exchange Online PowerShell V3 module (abbreviated as the EXO V3 module).
29
29
>
30
30
> As of June 2020, the instructions for connecting to standalone Exchange Online Protection PowerShell and Exchange Online PowerShell are basically the same. If you use the **Connect-IPPSSession** cmdlet with the _ConnectionUri_ parameter value `https://ps.protection.outlook.com/powershell-liveid/`, you're redirected to the same `https://outlook.office365.com/powershell-liveid/` endpoint that's used by **Connect-ExchangeOnline** for Exchange Online PowerShell connections.
31
-
>
31
+
>
32
32
> Remote PowerShell support in Exchange Online PowerShell will be deprecated. For more information, see [Announcing Deprecation of Remote PowerShell (RPS) Protocol in Exchange Online PowerShell](https://aka.ms/RPSDeprecation).
0 commit comments