Skip to content

Commit 6b294f6

Browse files
committed
Command links
1 parent 996aa25 commit 6b294f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/active-directory/roles/admin-units-assign-roles.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ You can assign an Azure AD role with an administrative unit scope by using the A
9090
9191
### PowerShell
9292

93+
Use the [New-AzureADMSRoleAssignment](/powershell/module/azuread/new-azureadmsroleassignment) command and the `DirectoryScopeId` parameter to assign a role with administrative unit scope.
94+
9395
```powershell
9496
$user = Get-AzureADUser -Filter "userPrincipalName eq 'Example_UPN'"
9597
$roleDefinition = Get-AzureADMSRoleDefinition -Filter "displayName eq 'Example_role_name'"
@@ -98,8 +100,6 @@ $directoryScope = '/administrativeUnits/' + $adminUnit.Id
98100
$roleAssignment = New-AzureADMSRoleAssignment -DirectoryScopeId $directoryScope -RoleDefinitionId $roleDefinition.Id -PrincipalId $user.objectId
99101
```
100102

101-
You can change the highlighted section as required for the specific environment.
102-
103103
### Microsoft Graph API
104104

105105
Request
@@ -135,13 +135,13 @@ You can view all the role assignments created with an administrative unit scope
135135

136136
### PowerShell
137137

138+
Use the [Get-AzureADMSScopedRoleMembership](/powershell/module/azuread/get-azureadmsscopedrolemembership) command to list role assignments with administrative unit scope.
139+
138140
```powershell
139141
$adminUnit = Get-AzureADMSAdministrativeUnit -Filter "displayname eq 'Example_admin_unit_name'"
140142
Get-AzureADMSScopedRoleMembership -Id $adminUnit.Id | fl *
141143
```
142144

143-
You can change the highlighted section as required for your specific environment.
144-
145145
### Microsoft Graph API
146146

147147
Request

0 commit comments

Comments
 (0)