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
Copy file name to clipboardExpand all lines: articles/active-directory/enterprise-users/users-custom-security-attributes.md
+82-79Lines changed: 82 additions & 79 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
---
2
-
title: Assign or remove custom security attributes for a user (Preview) - Azure Active Directory
3
-
description: Assign or remove custom security attributes for a user in Azure Active Directory.
2
+
title: Assign, update, list, or remove custom security attributes for a user (Preview) - Azure Active Directory
3
+
description: Assign, update, list, or remove custom security attributes for a user in Azure Active Directory.
4
4
services: active-directory
5
5
author: rolyon
6
6
ms.author: rolyon
7
-
ms.date: 06/24/2022
7
+
ms.date: 02/20/2023
8
8
ms.topic: how-to
9
9
ms.service: active-directory
10
10
ms.subservice: enterprise-users
@@ -14,13 +14,13 @@ ms.reviewer:
14
14
ms.collection: M365-identity-device-management
15
15
---
16
16
17
-
# Assign or remove custom security attributes for a user (Preview)
17
+
# Assign, update, list, or remove custom security attributes for a user (Preview)
18
18
19
19
> [!IMPORTANT]
20
20
> Custom security attributes are currently in PREVIEW.
21
21
> 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.
22
22
23
-
[Custom security attributes](../fundamentals/custom-security-attributes-overview.md) in Azure Active Directory (Azure AD), part of Microsoft Entra, are business-specific attributes (key-value pairs) that you can define and assign to Azure AD objects. For example, you can assign custom security attribute to filter your employees or to help determine who gets access to resources. This article describes how to assign, update, remove, or filter custom security attributes for Azure AD.
23
+
[Custom security attributes](../fundamentals/custom-security-attributes-overview.md) in Azure Active Directory (Azure AD), part of Microsoft Entra, are business-specific attributes (key-value pairs) that you can define and assign to Azure AD objects. For example, you can assign custom security attribute to filter your employees or to help determine who gets access to resources. This article describes how to assign, update, list, or remove custom security attributes for Azure AD.
24
24
25
25
## Prerequisites
26
26
@@ -79,20 +79,6 @@ To assign or remove custom security attributes for a user in your Azure AD tenan
79
79
80
80
1. When finished, select **Save**.
81
81
82
-
## Remove custom security attribute assignments from a user
83
-
84
-
1. Sign in to the [Azure portal](https://portal.azure.com) or [Azure AD admin center](https://aad.portal.azure.com).
85
-
86
-
1. Select **Azure Active Directory** > **Users**.
87
-
88
-
1. Find and select the user that has the custom security attribute assignments you want to remove.
89
-
90
-
1. In the Manage section, select **Custom security attributes (preview)**.
91
-
92
-
1. Add check marks next to all the custom security attribute assignments you want to remove.
93
-
94
-
1. Select **Remove assignment**.
95
-
96
82
## Filter users based on custom security attributes
97
83
98
84
You can filter the list of custom security attributes assigned to users on the All users page.
@@ -101,9 +87,9 @@ You can filter the list of custom security attributes assigned to users on the A
101
87
102
88
1. Select **Azure Active Directory** > **Users**.
103
89
104
-
1. Select **Add filters** to open the Pick a field pane.
90
+
1. Select **Add filter** to open the Add filter pane.
@@ -115,18 +101,23 @@ You can filter the list of custom security attributes assigned to users on the A
115
101
116
102
1. To apply the filter, select **Apply**.
117
103
118
-
## PowerShell
104
+
## Remove custom security attribute assignments from a user
119
105
120
-
To manage custom security attribute assignments for users in your Azure AD organization, you can use PowerShell. The following commands can be used to manage assignments.
106
+
1. Sign in to the [Azure portal](https://portal.azure.com) or [Azure AD admin center](https://aad.portal.azure.com).
121
107
122
-
#### Get the custom security attribute assignments for a user
108
+
1. Select **Azure Active Directory** > **Users**.
123
109
124
-
Use the [Get-AzureADMSUser](/powershell/module/azuread/get-azureadmsuser) command to get the custom security attribute assignments for a user.
110
+
1. Find and select the user that has the custom security attribute assignments you want to remove.
1. In the Manage section, select **Custom security attributes (preview)**.
113
+
114
+
1. Add check marks next to all the custom security attribute assignments you want to remove.
115
+
116
+
1. Select **Remove assignment**.
117
+
118
+
## PowerShell
119
+
120
+
To manage custom security attribute assignments for users in your Azure AD organization, you can use PowerShell. The following commands can be used to manage assignments.
130
121
131
122
#### Assign a custom security attribute with a multi-string value to a user
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).
174
-
175
162
#### Get the custom security attribute assignments for a user
176
163
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.
164
+
Use the [Get-AzureADMSUser](/powershell/module/azuread/get-azureadmsuser) command to get the custom security attribute assignments for a user.
178
165
179
-
```http
180
-
GET https://graph.microsoft.com/beta/users/{id}?$select=customSecurityAttributes
If there are no custom security attributes assigned to the user or if the calling principal does not have access, the response will look like:
171
+
## Microsoft Graph API
184
172
185
-
```http
186
-
{
187
-
"customSecurityAttributes": null
188
-
}
189
-
```
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 [Examples: Assign, update, list, or remove custom security attribute assignments using the Microsoft Graph API](/graph/custom-security-attributes-examples).
190
174
191
175
#### Assign a custom security attribute with a string value to a user
#### Get the custom security attribute assignments for a user
341
+
342
+
Use the [Get user](/graph/api/user-get?view=graph-rest-beta&preserve-view=true) API to get the custom security attribute assignments for a user.
343
+
344
+
```http
345
+
GET https://graph.microsoft.com/beta/users/{id}?$select=customSecurityAttributes
346
+
```
347
+
348
+
If there are no custom security attributes assigned to the user or if the calling principal does not have access, the response will look like:
349
+
350
+
```http
351
+
{
352
+
"customSecurityAttributes": null
353
+
}
354
+
```
355
+
356
+
#### List all users with a custom security attribute assignment that equals a value
357
+
358
+
Use the [List users](/graph/api/user-list?view=graph-rest-beta&preserve-view=true) API to list all users with a custom security attribute assignment that equals a value. The following example retrieves users with a custom security attribute named `AppCountry` with a value that equals `Canada`. The filter value is case sensitive. You must add `ConsistencyLevel=eventual` in the request or the header. You must also include `$count=true` to ensure the request is routed correctly.
359
+
360
+
- Attribute set: `Marketing`
361
+
- Attribute: `AppCountry`
362
+
- Filter: AppCountry eq 'Canada'
363
+
364
+
```http
365
+
GET https://graph.microsoft.com/beta/users?$count=true&$select=id,displayName,customSecurityAttributes&$filter=customSecurityAttributes/Marketing/AppCountry eq 'Canada'
366
+
ConsistencyLevel: eventual
367
+
```
368
+
369
+
#### List all users with a custom security attribute assignment that starts with a value
370
+
371
+
Use the [List users](/graph/api/user-list?view=graph-rest-beta&preserve-view=true) API to list all users with a custom security attribute assignment that starts with a value. The following example retrieves users with a custom security attribute named `EmployeeId` with a value that starts with `GS`. The filter value is case sensitive. You must add `ConsistencyLevel=eventual` in the request or the header. You must also include `$count=true` to ensure the request is routed correctly.
372
+
373
+
- Attribute set: `Marketing`
374
+
- Attribute: `EmployeeId`
375
+
- Filter: EmployeeId startsWith 'GS'
376
+
377
+
```http
378
+
GET https://graph.microsoft.com/beta/users?$count=true&$select=id,displayName,customSecurityAttributes&$filter=startsWith(customSecurityAttributes/Marketing/EmployeeId,'GS')
379
+
ConsistencyLevel: eventual
380
+
```
381
+
382
+
#### List all users with a custom security attribute assignment that does not equal a value
383
+
384
+
Use the [List users](/graph/api/user-list?view=graph-rest-beta&preserve-view=true) API to list all users with a custom security attribute assignment that does not equal a value. The following example retrieves users with a custom security attribute named `AppCountry` with a value that does not equal `Canada`. The filter value is case sensitive. You must add `ConsistencyLevel=eventual` in the request or the header. You must also include `$count=true` to ensure the request is routed correctly.
385
+
386
+
- Attribute set: `Marketing`
387
+
- Attribute: `AppCountry`
388
+
- Filter: AppCountry ne 'Canada'
389
+
390
+
```http
391
+
GET https://graph.microsoft.com/beta/users?$count=true&$select=id,displayName,customSecurityAttributes&$filter=customSecurityAttributes/Marketing/AppCountry ne 'Canada'
392
+
ConsistencyLevel: eventual
393
+
```
394
+
356
395
#### Remove a single-valued custom security attribute assignment from a user
357
396
358
397
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.
#### Filter all users with an attribute that equals a value
401
-
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.
403
-
404
-
- Attribute set: `Marketing`
405
-
- Attribute: `AppCountry`
406
-
- Filter: AppCountry eq 'Canada'
407
-
408
-
```http
409
-
GET https://graph.microsoft.com/beta/users?$count=true&$select=id,displayName,customSecurityAttributes&$filter=customSecurityAttributes/Marketing/AppCountry%20eq%20'Canada'
410
-
```
411
-
412
-
#### Filter all users with an attribute that starts with a value
413
-
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.
415
-
416
-
- Attribute set: `Marketing`
417
-
- Attribute: `EmployeeId`
418
-
- Filter: EmployeeId startsWith '111'
419
-
420
-
```http
421
-
GET https://graph.microsoft.com/beta/users?$count=true&$select=id,displayName,customSecurityAttributes&$filter=startsWith(customSecurityAttributes/Marketing/EmployeeId,'111')
422
-
```
423
-
424
-
#### Filter all users with an attribute that does not equal a value
425
-
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.
427
-
428
-
- Attribute set: `Marketing`
429
-
- Attribute: `AppCountry`
430
-
- Filter: AppCountry ne 'Canada'
431
-
432
-
```http
433
-
GET https://graph.microsoft.com/beta/users?$count=true&$select=id,displayName,customSecurityAttributes&$filter=customSecurityAttributes/Marketing/AppCountry%20ne%20'Canada'
434
-
```
435
-
436
439
## Frequently asked questions
437
440
438
441
**Where are custom security attributes for users supported?**
@@ -470,5 +473,5 @@ No, custom security attributes are not supported in B2C tenants and are not rela
470
473
## Next steps
471
474
472
475
-[Add or deactivate custom security attributes in Azure AD](../fundamentals/custom-security-attributes-add.md)
473
-
-[Assign or remove custom security attributes for an application](../manage-apps/custom-security-attributes-apps.md)
476
+
-[Assign, update, list, or remove custom security attributes for an application](../manage-apps/custom-security-attributes-apps.md)
474
477
-[Troubleshoot custom security attributes in Azure AD](../fundamentals/custom-security-attributes-troubleshoot.md)
Copy file name to clipboardExpand all lines: articles/active-directory/fundamentals/custom-security-attributes-troubleshoot.md
+22-2Lines changed: 22 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ms.service: active-directory
8
8
ms.subservice: fundamentals
9
9
ms.workload: identity
10
10
ms.topic: how-to
11
-
ms.date: 01/14/2022
11
+
ms.date: 02/20/2023
12
12
ms.collection: M365-identity-device-management
13
13
---
14
14
@@ -90,7 +90,7 @@ There are no custom security attributes defined and assigned yet for your tenant
90
90
91
91
**Solution 3**
92
92
93
-
Add and assign custom security attributes to users or enterprise applications. For more information, see [Add or deactivate custom security attributes in Azure AD](custom-security-attributes-add.md), [Assignor remove custom security attributes for a user](../enterprise-users/users-custom-security-attributes.md), or [Assign or remove custom security attributes for an application](../manage-apps/custom-security-attributes-apps.md).
93
+
Add and assign custom security attributes to users or enterprise applications. For more information, see [Add or deactivate custom security attributes in Azure AD](custom-security-attributes-add.md), [Assign, update, list, or remove custom security attributes for a user](../enterprise-users/users-custom-security-attributes.md), or [Assign, update, list, or remove custom security attributes for an application](../manage-apps/custom-security-attributes-apps.md).
94
94
95
95
## Symptom - Custom security attributes cannot be deleted
96
96
@@ -140,6 +140,26 @@ You are not assigned the required custom security attribute role to make the API
140
140
141
141
Make sure that you are assigned the required custom security attribute role. For more information, see [Manage access to custom security attributes in Azure AD](custom-security-attributes-manage.md).
142
142
143
+
## Symptom - Request_UnsupportedQuery error
144
+
145
+
When you try to call Microsoft Graph APIs for custom security attributes, you see a message similar to the following:
146
+
147
+
```
148
+
Bad Request - 400
149
+
Request_UnsupportedQuery
150
+
Unsupported or invalid query filter clause specified for property '<AttributeSet>_<Attribute>' of resource 'CustomSecurityAttributeValue'.
151
+
```
152
+
153
+
**Cause**
154
+
155
+
The request isn't formatted correctly.
156
+
157
+
**Solution**
158
+
159
+
If required, add `ConsistencyLevel=eventual` in the request or the header. You might also need to include `$count=true` to ensure the request is routed correctly. For more information, see [Examples: Assign, update, list, or remove custom security attribute assignments using the Microsoft Graph API](/graph/custom-security-attributes-examples).
160
+
161
+

162
+
143
163
## Next steps
144
164
145
165
-[Manage access to custom security attributes in Azure AD](custom-security-attributes-manage.md)
0 commit comments