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
@@ -23,8 +23,8 @@ This article describes the property sets that are available in the nine exclusiv
23
23
24
24
For more information about filtering with cmdlets in the module, see [Filters in the Exchange Online PowerShell module](filters-v2.md).
25
25
26
-
> [!NOTE]
27
-
> 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).
26
+
> [!TIP]
27
+
> Version 3.0.0 and later (2022) is known as the Exchange Online PowerShell V3 module (abbreviated as the EXO V3 module). Version 2.0.5 and earlier (2021) was known as the Exchange Online PowerShell V2 module (abbreviated as the EXO V2 module).
Copy file name to clipboardExpand all lines: exchange/docs-conceptual/connect-exo-powershell-managed-identity.md
+51-17Lines changed: 51 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Use Azure managed identities to connect to Exchange Online PowerShell
3
3
ms.author: chrisda
4
4
author: chrisda
5
5
manager: dansimp
6
-
ms.date: 6/21/2023
6
+
ms.date: 8/24/2023
7
7
ms.audience: Admin
8
8
audience: Admin
9
9
ms.topic: article
@@ -19,7 +19,7 @@ description: "Learn about using the Exchange Online PowerShell V3 module and Azu
19
19
20
20
# Use Azure managed identities to connect to Exchange Online PowerShell
21
21
22
-
Using the [Exchange Online PowerShell V3 module](exchange-online-powershell-v2.md#updates-for-the-exo-v3-module), you can connect to Exchange Online PowerShell using a user-assigned or system assigned Azure managed identity. For more information about managed identities, see [What are managed identities for Azure resources?](/azure/active-directory/managed-identities-azure-resources/overview).
22
+
Using the [Exchange Online PowerShell V3 module](exchange-online-powershell-v2.md#rest-api-connections-in-the-exo-v3-module), you can connect to Exchange Online PowerShell using a user-assigned or system assigned Azure managed identity. For more information about managed identities, see [What are managed identities for Azure resources?](/azure/active-directory/managed-identities-azure-resources/overview).
23
23
24
24
Unlike other connection methods using the Exchange Online PowerShell module, you can't run the connection commands in a Windows PowerShell session on your local computer. Instead, you connect in the context of the Azure resource that's associated with the managed identity (for example, an Azure automation account or an Azure Virtual Machine).
25
25
@@ -34,6 +34,8 @@ The rest of this article explains how to connect using managed identity, and the
> 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).
37
+
>
38
+
> REST API connections in the V3 module require the PowerShellGet and PackageManagement modules. For more information, see [PowerShellGet for REST-based connections in Windows](exchange-online-powershell-v2.md#powershellget-for-rest-based-connections-in-windows).
37
39
38
40
## Connect to Exchange Online PowerShell using system-assigned managed identity
39
41
@@ -77,7 +79,7 @@ After you've successfully created, saved, and published the PowerShell runbook,
77
79
1. On the **Automation accounts** page at <https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Automation%2FAutomationAccounts>, select the Automation account.
78
80
2. In the details flyout that opens, start typing "Runbooks" in the **Search** box, and then select **Runbooks** from results.
79
81
3. On the **Runbooks** flyout that opens, select the runbook.
80
-
4. On the details page of the runbook, click**Start**.
82
+
4. On the details page of the runbook, select**Start**.
81
83
82
84
### Connect to Exchange Online PowerShell using Azure VMs with system-assigned managed identity
83
85
@@ -127,7 +129,7 @@ After you've successfully created the PowerShell runbook, do the following steps
127
129
1. On the **Automation accounts** page at <https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Automation%2FAutomationAccounts>, select the Automation account.
128
130
2. In the details flyout that opens, start typing "Runbooks" in the **Search** box, and then select **Runbooks** from results.
129
131
3. On the **Runbooks** flyout that opens, select the runbook.
130
-
4. On the details page of the runbook, click**Start**.
132
+
4. On the details page of the runbook, select**Start**.
131
133
132
134
### Connect to Exchange Online PowerShell using Azure VMs with system-assigned managed identities
To verify that the variable was captured successfully, run the command `$MI_ID`. The output should be a GUID value (for example, 9f164909-3007-466e-a1fe-28d20b16e2c2).
237
239
238
-
For detailed syntax and parameter information, see [Get-AzADServicePrincipal](/powershell/module/az.automation/get-azadserviceprincipal).
240
+
For detailed syntax and parameter information, see [Get-AzADServicePrincipal](/powershell/module/az.resources/get-azadserviceprincipal).
239
241
240
242
### Step 3: Add the Exchange Online PowerShell module to the managed identity
241
243
@@ -246,15 +248,15 @@ For detailed syntax and parameter information, see [Get-AzADServicePrincipal](/p
246
248
247
249
1. On the **Automation accounts** page at <https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Automation%2FAutomationAccounts>, select the Automation account.
248
250
2. In the details flyout that opens, start typing "Modules" in the **Search** box, and then select **Modules** from results.
249
-
3. On the **Modules** flyout that opens, click**Add a module**.
251
+
3. On the **Modules** flyout that opens, select**Add a module**.
250
252
4. On the **Add a module** page that opens, configure the following settings:
251
253
-**Upload a module file**: Select **Browse from gallery**.
252
254
-**PowerShell module file**: Select **Click here to browse from gallery**:
253
255
1. In the **Browse Gallery** page that opens, start typing "ExchangeOnlineManagement" in the **Search** box, press Enter, and then select **ExchangeOnlineManagement** from the results.
254
-
2. On the details page that opens, click**Select** to return to the **Add a module** page.
256
+
2. On the details page that opens, select**Select** to return to the **Add a module** page.
255
257
-**Runtime version**: Select **5.1** or **7.1 (Preview)**. To add both versions, repeat the steps in this section to add and select the other runtime version for the module.
256
258
257
-
When you're finished, click**Import**.
259
+
When you're finished, select**Import**.
258
260
259
261

260
262
@@ -301,7 +303,15 @@ The procedures in this step require the Microsoft Graph PowerShell SDK. For inst
If the command returns no results, the next step won't work. See the subsection at the end of this section to fix the issue before you continue.
305
315
306
316
3. Run the following commands to grant the Exchange.ManageAsApp API permission for the managed identity to call Exchange Online:
307
317
@@ -315,13 +325,37 @@ The procedures in this step require the Microsoft Graph PowerShell SDK. For inst
315
325
316
326
-`$MI_ID` is the Id (GUID) value of the managed identity that you stored in a variable in [Step 2](#step-2-store-the-system-assigned-managed-identity-in-a-variable).
317
327
-`$AppRoleID` is the Id (GUID) value of the **Exchange.ManageAsApp** API permission that's the same in every organization.
318
-
-`$ResourceID` is the Id (GUID) value of the **Office 365 Exchange Online** resource in Azure Active Directory. The Id value is different in every organization.
328
+
-`$ResourceID` is the Id (GUID) value of the **Office 365 Exchange Online** resource in Azure AD. The AppId value is the same in every organization, but the Id value is different in every organization.
319
329
320
330
For detailed syntax and parameter information, see the following articles:
1. Register an application in Azure AD as described in [Step 1: Register the application in Azure AD](app-only-auth-powershell-v2.md#step-1-register-the-application-in-azure-ad).
347
+
2. Assign the Office 365 Exchange Online \> Exchange.ManageAsApp API permission to the application using the "Modify the app manifest" method as described in [Step 2: Assign API permissions to the application](app-only-auth-powershell-v2.md#step-2-assign-api-permissions-to-the-application).
348
+
349
+
After you do these steps, run the **Get-MgServicePrincipal** command again to confirm that the Office 365 Exchange Online resource is available in Azure AD.
350
+
351
+
For even more information, run the following command to verify that the Exchange.ManageAsApp API permission (`dc50a0fb-09a3-484d-be87-e023b12c6440`) is available in the Office 365 Exchange Online resource:
Now that the Office 365 Exchange Online resource is available, return to Step 4.3 in this section.
358
+
325
359
### Step 5: Assign Azure AD roles to the managed identity
326
360
327
361
The supported Azure AD roles are described in the following list:
@@ -354,13 +388,13 @@ For general instructions about assigning roles in Azure AD, see [View and assign
354
388
355
389

356
390
357
-
3. On the **Assignments** page that opens, click**Add assignments**.
391
+
3. On the **Assignments** page that opens, select**Add assignments**.
358
392
359
393

360
394
361
395
4. In the **Add assignments** flyout that opens, find and select the managed identity you created or identified in [Step 1](#step-1-create-a-resource-with-system-assigned-managed-identity).
362
396
363
-
When you're finished, click**Add**.
397
+
When you're finished, select**Add**.
364
398
365
399
5. Back on the **Assignments** page, verify that the role has been assigned to the managed identity.
366
400
@@ -372,9 +406,9 @@ To assign a role to the managed identity in Microsoft Graph PowerShell, do the f
## Create and configure a user-assigned managed identity
402
436
@@ -405,7 +439,7 @@ The steps are:
405
439
1.[(Optional) Create a user-assigned managed identity](#step-1-create-a-user-assigned-managed-identity)
406
440
2.[(Optional) Create a resource with user-assigned managed identity](#step-2-create-a-resource-with-user-assigned-managed-identity)
407
441
3.[Store the user-assigned managed identity in a variable](#step-3-store-the-user-assigned-managed-identity-in-a-variable)
408
-
4.[Grant the Exchange.ManageAsApp API permission for the managed identity to call Exchange Online](#step-4-grant-the-exchangemanageasapp-api-permission-for-the-managed-identity-to-call-exchange-online)
442
+
4.[Add the Exchange Online PowerShell module to the managed identity](#step-4-add-the-exchange-online-powershell-module-to-the-managed-identity)
409
443
5.[Grant the Exchange.ManageAsApp API permission for the managed identity to call Exchange Online](#step-5-grant-the-exchangemanageasapp-api-permission-for-the-managed-identity-to-call-exchange-online)
410
444
6.[Assign Azure AD roles to the managed identity](#step-6-assign-azure-ad-roles-to-the-managed-identity)
0 commit comments