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
# Add users, groups, or devices to an administrative unit
20
20
21
-
> [!IMPORTANT]
22
-
> Administrative units support for devices is currently in PREVIEW.
23
-
> See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
24
-
25
21
In Azure Active Directory (Azure AD), you can add users, groups, or devices to an administrative unit to restrict the scope of role permissions. Adding a group to an administrative unit brings the group itself into the management scope of the administrative unit, but **not** the members of the group. For additional details on what scoped administrators can do, see [Administrative units in Azure Active Directory](administrative-units.md).
26
22
27
23
This article describes how to add users, groups, or devices to administrative units manually. For information about how to add users or devices to administrative units dynamically using rules, see [Manage users or devices for an administrative unit with dynamic membership rules](admin-units-members-dynamic.md).
@@ -31,8 +27,7 @@ This article describes how to add users, groups, or devices to administrative un
31
27
- Azure AD Premium P1 or P2 license for each administrative unit administrator
32
28
- Azure AD Free licenses for administrative unit members
33
29
- Privileged Role Administrator or Global Administrator
34
-
- AzureAD module when using PowerShell
35
-
- AzureADPreview module when using PowerShell for devices
30
+
- Microsoft Graph PowerShell
36
31
- Admin consent when using Graph explorer for Microsoft Graph API
37
32
38
33
For more information, see [Prerequisites to use PowerShell or Graph Explorer](prerequisites.md).
@@ -125,47 +120,51 @@ You can add users, groups, or devices to administrative units using the Azure po
125
120
126
121
## PowerShell
127
122
128
-
Use the [Add-AzureADMSAdministrativeUnitMember](/powershell/module/azuread/add-azureadmsadministrativeunitmember) command to add users or groups to an administrative unit.
129
-
130
-
Use the [Add-AzureADMSAdministrativeUnitMember (Preview)](/powershell/module/azuread/add-azureadmsadministrativeunitmember?view=azureadps-2.0-preview&preserve-view=true) command to add devices to an administrative unit.
131
-
132
-
Use the [New-AzureADMSAdministrativeUnitMember (Preview)](/powershell/module/azuread/new-azureadmsadministrativeunitmember) to create a new group in an administrative unit. Currently, only group creation is supported with this command.
123
+
Use the [Invoke-MgGraphRequest](/powershell/microsoftgraph/authentication-commands#using-invoke-mggraphrequest) command to add user, groups, or devices to an administrative unit or create a new group in an administrative unit.
133
124
134
125
### Add users to an administrative unit
135
126
136
127
```powershell
137
-
$adminUnitObj = Get-AzureADMSAdministrativeUnit -Filter "displayname eq 'Test administrative unit 2'"
$exampleGroup = New-AzureADMSAdministrativeUnitMember -Id "<admin unit object id>" -OdataType "Microsoft.Graph.Group" -DisplayName "<Example group name>" -Description "<Example group description>" -MailEnabled $True -MailNickname "<examplegroup>" -SecurityEnabled $False -GroupTypes @("Unified")
152
+
$exampleGroup = Invoke-MgGraphRequest -Method POST -Uri https://graph.microsoft.com/v1.0/directory/administrativeUnits/{ADMIN_UNIT_ID}/members/ -Body '{
153
+
"@odata.type": "#Microsoft.Graph.Group",
154
+
"description": "{Example group description}",
155
+
"displayName": "{Example group name}",
156
+
"groupTypes": [
157
+
"Unified"
158
+
],
159
+
"mailEnabled": true,
160
+
"mailNickname": "{exampleGroup}",
161
+
"securityEnabled": false
162
+
}'
162
163
```
163
164
164
165
## Microsoft Graph API
165
166
166
-
Use the [Add a member](/graph/api/administrativeunit-post-members) API to add users or groups to an administrative unit.
167
-
168
-
Use the [Add a member (Beta)](/graph/api/administrativeunit-post-members?view=graph-rest-beta&preserve-view=true) API to add devices to an administrative unit or create a new group in an administrative unit.
167
+
Use the [Add a member](/graph/api/administrativeunit-post-members) API to add users, groups, or devices to an administrative unit or create a new group in an administrative unit.
169
168
170
169
### Add users to an administrative unit
171
170
@@ -220,14 +219,14 @@ Example
220
219
Request
221
220
222
221
```http
223
-
POST https://graph.microsoft.com/beta/administrativeUnits/{admin-unit-id}/members/$ref
222
+
POST https://graph.microsoft.com/v1.0/directory/administrativeUnits/{admin-unit-id}/members/$ref
If you want to manage Azure Active Directory (Azure AD) roles using PowerShell or Graph Explorer, you must have the required prerequisites. This article describes the PowerShell and Graph Explorer prerequisites for different Azure AD role features.
22
22
23
+
## Microsoft Graph PowerShell
24
+
25
+
To use PowerShell commands to do the following:
26
+
27
+
- Add users, groups, or devices to an administrative unit
28
+
- Create a new group in an administrative unit
29
+
30
+
You must have the Microsoft Graph PowerShell SDK installed:
0 commit comments