Skip to content

Commit c455f6b

Browse files
authored
Merge pull request #10746 from hnguyen1218/patch-1
Update app-only-auth-powershell-v2.md
2 parents ff42315 + 3dd33b0 commit c455f6b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: App-only authentication in Exchange Online PowerShell and Security & Comp
33
ms.author: chrisda
44
author: chrisda
55
manager: dansimp
6-
ms.date: 01/31/2023
6+
ms.date: 4/20/2023
77
ms.audience: Admin
88
audience: Admin
99
ms.topic: article
@@ -408,11 +408,13 @@ For general instructions about assigning roles in Azure AD, see [View and assign
408408
#### Assign custom Exchange Online role groups to the application using service principals
409409

410410
> [!NOTE]
411-
> 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).
412414
413415
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.
414416

415-
To assign custom Exchange Online role groups to the application using service principals, do the following steps:
417+
To assign custom role groups to the application using service principals, do the following steps:
416418

417419
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:
418420

@@ -428,8 +430,8 @@ To assign custom Exchange Online role groups to the application using service pr
428430

429431
For detailed syntax and parameter information, see [Get-AzureADServicePrincipal](/powershell/module/azuread/get-azureadserviceprincipal).
430432

431-
2. In the same PowerShell window, connect to [Exchange Online PowerShell](connect-to-exchange-online-powershell.md) and run the following commands to:
432-
- 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.
433435
- Store the details of the service principal in a variable.
434436

435437
```powershell
@@ -448,7 +450,7 @@ To assign custom Exchange Online role groups to the application using service pr
448450

449451
For detailed syntax and parameter information, see [New-ServicePrincipal](/powershell/module/exchange/new-serviceprincipal).
450452

451-
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:
452454

453455
```powershell
454456
Add-RoleGroupMember -Identity "<CustomRoleGroupName>" -Member <$<VariableName2>.Identity | $<VariableName2>.ServiceId | $<VariableName2>.Id>

0 commit comments

Comments
 (0)