Skip to content

Commit 5a42ca7

Browse files
authored
Merge pull request #187287 from rolyon/rolyon-abac-attributes-powershell-graph-api-links
[Azure ABAC] PowerShell and Graph API links
2 parents 8fac4fa + 9f438e7 commit 5a42ca7

File tree

3 files changed

+108
-18
lines changed

3 files changed

+108
-18
lines changed

articles/active-directory/enterprise-users/users-custom-security-attributes.md

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Assign or remove custom security attributes for a user in Azure Act
44
services: active-directory
55
author: rolyon
66
ms.author: rolyon
7-
ms.date: 11/16/2021
7+
ms.date: 02/03/2022
88
ms.topic: how-to
99
ms.service: active-directory
1010
ms.subservice: enterprise-users
@@ -121,13 +121,17 @@ To manage custom security attribute assignments for users in your Azure AD organ
121121

122122
#### Get the custom security attribute assignments for a user
123123

124+
Use the [Get-AzureADMSUser](/powershell/module/azuread/get-azureadmsuser) command to get the custom security attribute assignments for a user.
125+
124126
```powershell
125127
$user1 = Get-AzureADMSUser -Id dbb22700-a7de-4372-ae78-0098ee60e55e -Select CustomSecurityAttributes
126128
$user1.CustomSecurityAttributes
127129
```
128130

129131
#### Assign a custom security attribute with a multi-string value to a user
130132

133+
Use the [Set-AzureADMSUser](/powershell/module/azuread/set-azureadmsuser) command to assign a custom security attribute with a multi-string value to a user.
134+
131135
- Attribute set: `Engineering`
132136
- Attribute: `Project`
133137
- Attribute data type: Collection of Strings
@@ -146,6 +150,8 @@ Set-AzureADMSUser -Id dbb22700-a7de-4372-ae78-0098ee60e55e -CustomSecurityAttrib
146150

147151
#### Update a custom security attribute with a multi-string value for a user
148152

153+
Use the [Set-AzureADMSUser](/powershell/module/azuread/set-azureadmsuser) command to update a custom security attribute with a multi-string value for a user.
154+
149155
- Attribute set: `Engineering`
150156
- Attribute: `Project`
151157
- Attribute data type: Collection of Strings
@@ -164,10 +170,12 @@ Set-AzureADMSUser -Id dbb22700-a7de-4372-ae78-0098ee60e55e -CustomSecurityAttrib
164170

165171
## Microsoft Graph API
166172

167-
To manage custom security attribute assignments for users in your Azure AD organization, you can use the Microsoft Graph API. The following API calls can be made to manage assignments.
173+
To manage custom security attribute assignments for users in your Azure AD organization, you can use the Microsoft Graph API. The following API calls can be made to manage assignments. For more information, see [Assign, update, or remove custom security attributes using the Microsoft Graph API](/graph/custom-security-attributes-examples).
168174

169175
#### Get the custom security attribute assignments for a user
170176

177+
Use the [Get a user](/graph/api/user-get?view=graph-rest-beta&preserve-view=true) API to get the custom security attribute assignments for a user.
178+
171179
```http
172180
GET https://graph.microsoft.com/beta/users/{id}?$select=customSecurityAttributes
173181
```
@@ -182,6 +190,8 @@ If there are no custom security attributes assigned to the user or if the callin
182190

183191
#### Assign a custom security attribute with a string value to a user
184192

193+
Use the [Update user](/graph/api/user-update?view=graph-rest-beta&preserve-view=true) API to assign a custom security attribute with a string value to a user.
194+
185195
- Attribute set: `Engineering`
186196
- Attribute: `ProjectDate`
187197
- Attribute data type: String
@@ -203,6 +213,8 @@ PATCH https://graph.microsoft.com/beta/users/{id}
203213

204214
#### Assign a custom security attribute with a multi-string value to a user
205215

216+
Use the [Update user](/graph/api/user-update?view=graph-rest-beta&preserve-view=true) API to assign a custom security attribute with a multi-string value to a user.
217+
206218
- Attribute set: `Engineering`
207219
- Attribute: `Project`
208220
- Attribute data type: Collection of Strings
@@ -225,6 +237,8 @@ PATCH https://graph.microsoft.com/beta/users/{id}
225237

226238
#### Assign a custom security attribute with an integer value to a user
227239

240+
Use the [Update user](/graph/api/user-update?view=graph-rest-beta&preserve-view=true) API to assign a custom security attribute with an integer value to a user.
241+
228242
- Attribute set: `Engineering`
229243
- Attribute: `NumVendors`
230244
- Attribute data type: Integer
@@ -247,6 +261,8 @@ PATCH https://graph.microsoft.com/beta/users/{id}
247261

248262
#### Assign a custom security attribute with a multi-integer value to a user
249263

264+
Use the [Update user](/graph/api/user-update?view=graph-rest-beta&preserve-view=true) API to assign a custom security attribute with a multi-integer value to a user.
265+
250266
- Attribute set: `Engineering`
251267
- Attribute: `CostCenter`
252268
- Attribute data type: Collection of Integers
@@ -269,6 +285,8 @@ PATCH https://graph.microsoft.com/beta/users/{id}
269285

270286
#### Assign a custom security attribute with a Boolean value to a user
271287

288+
Use the [Update user](/graph/api/user-update?view=graph-rest-beta&preserve-view=true) API to assign a custom security attribute with a Boolean value to a user.
289+
272290
- Attribute set: `Engineering`
273291
- Attribute: `Certification`
274292
- Attribute data type: Boolean
@@ -290,6 +308,8 @@ PATCH https://graph.microsoft.com/beta/users/{id}
290308

291309
#### Update a custom security attribute with an integer value for a user
292310

311+
Use the [Update user](/graph/api/user-update?view=graph-rest-beta&preserve-view=true) API to update a custom security attribute with an integer value for a user.
312+
293313
- Attribute set: `Engineering`
294314
- Attribute: `NumVendors`
295315
- Attribute data type: Integer
@@ -312,6 +332,8 @@ PATCH https://graph.microsoft.com/beta/users/{id}
312332

313333
#### Update a custom security attribute with a Boolean value for a user
314334

335+
Use the [Update user](/graph/api/user-update?view=graph-rest-beta&preserve-view=true) API to update a custom security attribute with a Boolean value for a user.
336+
315337
- Attribute set: `Engineering`
316338
- Attribute: `Certification`
317339
- Attribute data type: Boolean
@@ -333,7 +355,7 @@ PATCH https://graph.microsoft.com/beta/users/{id}
333355

334356
#### Remove a single-valued custom security attribute assignment from a user
335357

336-
To remove a single-valued custom security attribute assignment, set the value to null.
358+
Use the [Update user](/graph/api/user-update?view=graph-rest-beta&preserve-view=true) API to remove a single-valued custom security attribute assignment from a user by setting the value to null.
337359

338360
- Attribute set: `Engineering`
339361
- Attribute: `ProjectDate`
@@ -355,7 +377,7 @@ PATCH https://graph.microsoft.com/beta/users/{id}
355377

356378
#### Remove a multi-valued custom security attribute assignment from a user
357379

358-
To remove a multi-valued custom security attribute assignment, set the value to an empty collection.
380+
Use the [Update user](/graph/api/user-update?view=graph-rest-beta&preserve-view=true) API to remove a multi-valued custom security attribute assignment from a user by setting the value to an empty collection.
359381

360382
- Attribute set: `Engineering`
361383
- Attribute: `Project`
@@ -377,7 +399,7 @@ PATCH https://graph.microsoft.com/beta/users/{id}
377399

378400
#### Filter all users with an attribute that equals a value
379401

380-
The following example, retrieves users with an `AppCountry` attribute that equals `Canada`. You must add `ConsistencyLevel: eventual` in the header. You must also include `$count=true` to ensure the request is routed correctly.
402+
Use the [List users](/graph/api/user-list?view=graph-rest-beta&preserve-view=true) API to filter all users with an attribute that equals a value. The following example, retrieves users with an `AppCountry` attribute that equals `Canada`. You must add `ConsistencyLevel: eventual` in the header. You must also include `$count=true` to ensure the request is routed correctly.
381403

382404
- Attribute set: `Marketing`
383405
- Attribute: `AppCountry`
@@ -389,7 +411,7 @@ GET https://graph.microsoft.com/beta/users?$count=true&$select=id,displayName,cu
389411

390412
#### Filter all users with an attribute that starts with a value
391413

392-
The following example, retrieves users with an `EmployeeId` attribute that starts with `111`. You must add `ConsistencyLevel: eventual` in the header. You must also include `$count=true` to ensure the request is routed correctly.
414+
Use the [List users](/graph/api/user-list?view=graph-rest-beta&preserve-view=true) API to filter all users with an attribute that starts with a value. The following example, retrieves users with an `EmployeeId` attribute that starts with `111`. You must add `ConsistencyLevel: eventual` in the header. You must also include `$count=true` to ensure the request is routed correctly.
393415

394416
- Attribute set: `Marketing`
395417
- Attribute: `EmployeeId`
@@ -401,7 +423,7 @@ GET https://graph.microsoft.com/beta/users?$count=true&$select=id,displayName,cu
401423

402424
#### Filter all users with an attribute that does not equal a value
403425

404-
The following example, retrieves users with a `AppCountry` attribute that does not equal `Canada`. This query will also retrieve users that do not have the `AppCountry` attribute assigned. You must add `ConsistencyLevel: eventual` in the header. You must also include `$count=true` to ensure the request is routed correctly.
426+
Use the [List users](/graph/api/user-list?view=graph-rest-beta&preserve-view=true) API to filter all users with an attribute that does not equal a value. The following example, retrieves users with a `AppCountry` attribute that does not equal `Canada`. This query will also retrieve users that do not have the `AppCountry` attribute assigned. You must add `ConsistencyLevel: eventual` in the header. You must also include `$count=true` to ensure the request is routed correctly.
405427

406428
- Attribute set: `Marketing`
407429
- Attribute: `AppCountry`

0 commit comments

Comments
 (0)