Skip to content

Commit f49c8e4

Browse files
committed
Merge branch 'main' into ITRC-chrisda
2 parents 17b3b0a + 267af2a commit f49c8e4

File tree

252 files changed

+795
-552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

252 files changed

+795
-552
lines changed

exchange/docs-conceptual/app-only-auth-powershell-v2.md

Lines changed: 130 additions & 58 deletions
Large diffs are not rendered by default.

exchange/docs-conceptual/connect-exo-powershell-managed-identity.md

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Use Azure managed identities to connect to Exchange Online PowerShell
33
ms.author: chrisda
44
author: chrisda
55
manager: dansimp
6-
ms.date: 6/21/2023
6+
ms.date: 8/24/2023
77
ms.audience: Admin
88
audience: Admin
99
ms.topic: article
@@ -34,6 +34,8 @@ The rest of this article explains how to connect using managed identity, and the
3434
> - [Add-UnifiedGroupLinks](/powershell/module/exchange/add-unifiedgrouplinks)
3535
>
3636
> 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).
3739
3840
## Connect to Exchange Online PowerShell using system-assigned managed identity
3941

@@ -77,7 +79,7 @@ After you've successfully created, saved, and published the PowerShell runbook,
7779
1. On the **Automation accounts** page at <https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Automation%2FAutomationAccounts>, select the Automation account.
7880
2. In the details flyout that opens, start typing "Runbooks" in the ![Search icon.](media/search-icon.png) **Search** box, and then select **Runbooks** from results.
7981
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**.
8183

8284
### Connect to Exchange Online PowerShell using Azure VMs with system-assigned managed identity
8385

@@ -127,7 +129,7 @@ After you've successfully created the PowerShell runbook, do the following steps
127129
1. On the **Automation accounts** page at <https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Automation%2FAutomationAccounts>, select the Automation account.
128130
2. In the details flyout that opens, start typing "Runbooks" in the ![Search icon.](media/search-icon.png) **Search** box, and then select **Runbooks** from results.
129131
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**.
131133

132134
### Connect to Exchange Online PowerShell using Azure VMs with system-assigned managed identities
133135

@@ -235,7 +237,7 @@ $MI_ID = (Get-AzADServicePrincipal -DisplayName "ContosoAzAuto1").Id
235237

236238
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).
237239

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).
239241

240242
### Step 3: Add the Exchange Online PowerShell module to the managed identity
241243

@@ -246,15 +248,15 @@ For detailed syntax and parameter information, see [Get-AzADServicePrincipal](/p
246248
247249
1. On the **Automation accounts** page at <https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Automation%2FAutomationAccounts>, select the Automation account.
248250
2. In the details flyout that opens, start typing "Modules" in the ![Search icon.](media/search-icon.png) **Search** box, and then select **Modules** from results.
249-
3. On the **Modules** flyout that opens, click ![Add module icon.](media/add-icon.png) **Add a module**.
251+
3. On the **Modules** flyout that opens, select ![Add module icon.](media/add-icon.png) **Add a module**.
250252
4. On the **Add a module** page that opens, configure the following settings:
251253
- **Upload a module file**: Select **Browse from gallery**.
252254
- **PowerShell module file**: Select **Click here to browse from gallery**:
253255
1. In the **Browse Gallery** page that opens, start typing "ExchangeOnlineManagement" in the ![Search icon.](media/search-icon.png) **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.
255257
- **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.
256258

257-
When you're finished, click **Import**.
259+
When you're finished, select **Import**.
258260

259261
![Screenshot of adding a module to an Automation account in the Azure portal.](media/mi-add-exo-module.png)
260262

@@ -301,7 +303,15 @@ The procedures in this step require the Microsoft Graph PowerShell SDK. For inst
301303
Connect-MgGraph -Scopes AppRoleAssignment.ReadWrite.All,Application.Read.All
302304
```
303305

304-
2. If a **Permissions requested** dialog opens, select **Consent on behalf of your organization**, and then click **Accept**.
306+
If a **Permissions requested** dialog opens, select **Consent on behalf of your organization**, and then click **Accept**.
307+
308+
2. Run the following command to verify that the Office 365 Exchange Online resource is available in Azure AD:
309+
310+
```powershell
311+
Get-MgServicePrincipal -Filter "AppId eq '00000002-0000-0ff1-ce00-000000000000'"
312+
```
313+
314+
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.
305315

306316
3. Run the following commands to grant the Exchange.ManageAsApp API permission for the managed identity to call Exchange Online:
307317

@@ -315,13 +325,37 @@ The procedures in this step require the Microsoft Graph PowerShell SDK. For inst
315325

316326
- `$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).
317327
- `$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.
319329

320330
For detailed syntax and parameter information, see the following articles:
321331

322-
- [Connect-MgGraph](/powershell/module/microsoft.graph.applications/new-mgserviceprincipalapproleassignment).
332+
- [Connect-MgGraph](/powershell/module/microsoft.graph.applications/new-mgserviceprincipalapproleassignment)
333+
- [Get-MgServicePrincipal](/powershell/module/microsoft.graph.applications/get-mgserviceprincipal)
323334
- [New-MgServicePrincipalAppRoleAssignment](/powershell/module/microsoft.graph.applications/new-mgserviceprincipalapproleassignment)
324335

336+
#### What to do if the Office 365 Exchange Online resource is not available in Azure AD
337+
338+
If the following command returns no results:
339+
340+
```powershell
341+
Get-MgServicePrincipal -Filter "AppId eq '00000002-0000-0ff1-ce00-000000000000'"
342+
```
343+
344+
Do the following steps:
345+
346+
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:
352+
353+
```powershell
354+
Get-MgServicePrincipal -Filter "AppId eq '00000002-0000-0ff1-ce00-000000000000'" | Select-Object -ExpandProperty AppRoles | Format-Table Value,Id
355+
```
356+
357+
Now that the Office 365 Exchange Online resource is available, return to Step 4.3 in this section.
358+
325359
### Step 5: Assign Azure AD roles to the managed identity
326360

327361
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
354388

355389
![Find and select a supported Exchange Online PowerShell role by clicking on the role name.](media/exo-app-only-auth-find-and-select-supported-role.png)
356390

357-
3. On the **Assignments** page that opens, click **Add assignments**.
391+
3. On the **Assignments** page that opens, select **Add assignments**.
358392

359393
![Select Add assignments on the role assignments page for Exchange Online PowerShell.](media/exo-app-only-auth-role-assignments-click-add-assignments.png)
360394

361395
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).
362396

363-
When you're finished, click **Add**.
397+
When you're finished, select **Add**.
364398

365399
5. Back on the **Assignments** page, verify that the role has been assigned to the managed identity.
366400

@@ -372,9 +406,9 @@ To assign a role to the managed identity in Microsoft Graph PowerShell, do the f
372406
Connect-MgGraph -Scopes RoleManagement.ReadWrite.Directory
373407
```
374408

375-
2. If a **Permissions requested** dialog opens, select **Consent on behalf of your organization**, and then click **Accept**.
409+
If a **Permissions requested** dialog opens, select **Consent on behalf of your organization**, and then click **Accept**.
376410

377-
3. Use the following syntax to assign the required Azure AD role to the managed identity:
411+
2. Use the following syntax to assign the required Azure AD role to the managed identity:
378412

379413
```powershell
380414
$RoleID = (Get-MgRoleManagementDirectoryRoleDefinition -Filter "DisplayName eq '<Role Name>'").Id
@@ -396,7 +430,7 @@ To assign a role to the managed identity in Microsoft Graph PowerShell, do the f
396430
For detailed syntax and parameter information, see the following articles:
397431

398432
- [Connect-MgGraph](/powershell/module/microsoft.graph.applications/new-mgserviceprincipalapproleassignment).
399-
- [New-MgRoleManagementDirectoryRoleAssignment](/powershell/module/microsoft.graph.applications/new-mgrolemanagementdirectoryroleassignment)
433+
- [New-MgRoleManagementDirectoryRoleAssignment](/powershell/module/microsoft.graph.identity.governance/new-mgrolemanagementdirectoryroleassignment)
400434

401435
## Create and configure a user-assigned managed identity
402436

exchange/docs-conceptual/connect-to-exchange-online-powershell.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Connect to Exchange Online PowerShell
33
author: chrisda
44
manager: dansimp
5-
ms.date: 7/20/2023
5+
ms.date: 8/21/2023
66
ms.audience: Admin
77
audience: Admin
88
ms.topic: article
@@ -13,7 +13,7 @@ ms.collection: Strat_EX_Admin
1313
ms.custom:
1414
ms.assetid:
1515
search.appverid: MET150
16-
description: "Learn how to use the Exchange Online PowerShell V2 module or V3 module to connect to Exchange Online PowerShell with modern authentication and/or multi-factor authentication (MFA)."
16+
description: "Learn how to use the Exchange Online PowerShell V3 module to connect to Exchange Online PowerShell with modern authentication and/or multi-factor authentication (MFA)."
1717
---
1818

1919
# Connect to Exchange Online PowerShell
@@ -22,9 +22,6 @@ This article contains instructions for how to connect to Exchange Online PowerSh
2222

2323
The Exchange Online PowerShell module uses modern authentication for connecting to all Exchange-related PowerShell environments in Microsoft 365: Exchange Online PowerShell, Security & Compliance PowerShell, and standalone Exchange Online Protection (EOP) PowerShell. For more information about the Exchange Online PowerShell module, see [About the Exchange Online PowerShell module](exchange-online-powershell-v2.md).
2424

25-
> [!NOTE]
26-
> 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).
27-
2825
To connect to Exchange Online PowerShell for automation, see [App-only authentication for unattended scripts](app-only-auth-powershell-v2.md) and [Use Azure managed identities to connect to Exchange Online PowerShell](connect-exo-powershell-managed-identity.md).
2926

3027
To connect to Exchange Online PowerShell from C#, see [Use C# to connect to Exchange Online PowerShell](connect-to-exo-powershell-c-sharp.md).
@@ -35,6 +32,8 @@ To connect to Exchange Online PowerShell from C#, see [Use C# to connect to Exch
3532

3633
> [!NOTE]
3734
> Remote PowerShell connections are deprecated in Exchange Online PowerShell. For more information, see [Deprecation of Remote PowerShell in Exchange Online](https://techcommunity.microsoft.com/t5/exchange-team-blog/deprecation-of-remote-powershell-in-exchange-online-re-enabling/ba-p/3779692).
35+
>
36+
> REST API connections in the Exchange Online PowerShell 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).
3837
3938
- After you connect, the cmdlets and parameters that you have or don't have access to is controlled by role-based access control (RBAC). For more information, see [Permissions in Exchange Online](/exchange/permissions-exo/permissions-exo).
4039

exchange/docs-conceptual/connect-to-exchange-online-protection-powershell.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Connect to Exchange Online Protection PowerShell
33
author: chrisda
44
manager: dansimp
5-
ms.date: 7/20/2023
5+
ms.date: 8/21/2023
66
ms.audience: Admin
77
audience: Admin
88
ms.topic: article
@@ -13,7 +13,7 @@ ms.collection: Strat_EX_Admin
1313
ms.custom:
1414
ms.assetid:
1515
search.appverid: MET150
16-
description: "Learn how to use the Exchange Online PowerShell V2 module or V3 module to connect to standalone Exchange Online Protection PowerShell with modern authentication and/or multi-factor authentication (MFA)."
16+
description: "Learn how to use the Exchange Online PowerShell V3 module to connect to standalone Exchange Online Protection PowerShell with modern authentication and/or multi-factor authentication (MFA)."
1717
---
1818

1919
# Connect to Exchange Online Protection PowerShell
@@ -25,11 +25,11 @@ The Exchange Online PowerShell module uses modern authentication for connecting
2525
For more information about Exchange Online Protection PowerShell, see [Exchange Online Protection PowerShell](exchange-online-protection-powershell.md).
2626

2727
> [!NOTE]
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-
>
3028
> 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.
3129
>
3230
> Remote PowerShell connections in Exchange Online PowerShell are deprecated. For more information, see [Deprecation of Remote PowerShell in Exchange Online](https://techcommunity.microsoft.com/t5/exchange-team-blog/deprecation-of-remote-powershell-in-exchange-online-re-enabling/ba-p/3779692).
31+
>
32+
> REST API connections in the Exchange Online PowerShell 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).
3333
3434
## What do you need to know before you begin?
3535

exchange/docs-conceptual/connect-to-exo-powershell-c-sharp.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Use C# to connect to Exchange Online PowerShell
33
ms.author: chrisda
44
author: chrisda
55
manager: dansimp
6-
ms.date:
6+
ms.date: 8/21/2023
77
ms.audience: Admin
88
audience: Admin
99
ms.topic: article
@@ -23,6 +23,11 @@ The code samples in this article use the [Exchange Online PowerShell V3 module](
2323

2424
To install the Exchange Online PowerShell module, see [Install and maintain the Exchange Online PowerShell module](exchange-online-powershell-v2.md#install-and-maintain-the-exchange-online-powershell-module).
2525

26+
> [!TIP]
27+
> REST API connections in the Exchange Online PowerShell 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).
28+
>
29+
> If you get errors when you try to connect, use the _SkipLoadingFormatData_ switch on the **Connect-ExchangeOnline** cmdlet.
30+
2631
## Sample 1: Create a single connection using a PowerShell runspace
2732

2833
```csharp

0 commit comments

Comments
 (0)