Skip to content

Commit 389c574

Browse files
authored
Merge pull request #227902 from MicrosoftDocs/main
Publish to live, Sunday 4 PM PST, 2/19
2 parents ac63443 + c04ae1a commit 389c574

File tree

12 files changed

+179
-157
lines changed

12 files changed

+179
-157
lines changed
-3.21 KB
Loading

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

Lines changed: 82 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
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.
44
services: active-directory
55
author: rolyon
66
ms.author: rolyon
7-
ms.date: 06/24/2022
7+
ms.date: 02/20/2023
88
ms.topic: how-to
99
ms.service: active-directory
1010
ms.subservice: enterprise-users
@@ -14,13 +14,13 @@ ms.reviewer:
1414
ms.collection: M365-identity-device-management
1515
---
1616

17-
# Assign or remove custom security attributes for a user (Preview)
17+
# Assign, update, list, or remove custom security attributes for a user (Preview)
1818

1919
> [!IMPORTANT]
2020
> Custom security attributes are currently in PREVIEW.
2121
> 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.
2222
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.
2424

2525
## Prerequisites
2626

@@ -79,20 +79,6 @@ To assign or remove custom security attributes for a user in your Azure AD tenan
7979

8080
1. When finished, select **Save**.
8181

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-
9682
## Filter users based on custom security attributes
9783

9884
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
10187

10288
1. Select **Azure Active Directory** > **Users**.
10389

104-
1. Select **Add filters** to open the Pick a field pane.
90+
1. Select **Add filter** to open the Add filter pane.
10591

106-
1. For **Filters**, select **Custom security attribute**.
92+
1. Select **Custom security attributes**.
10793

10894
1. Select your attribute set and attribute name.
10995

@@ -115,18 +101,23 @@ You can filter the list of custom security attributes assigned to users on the A
115101

116102
1. To apply the filter, select **Apply**.
117103

118-
## PowerShell
104+
## Remove custom security attribute assignments from a user
119105

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).
121107

122-
#### Get the custom security attribute assignments for a user
108+
1. Select **Azure Active Directory** > **Users**.
123109

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.
125111

126-
```powershell
127-
$user1 = Get-AzureADMSUser -Id dbb22700-a7de-4372-ae78-0098ee60e55e -Select CustomSecurityAttributes
128-
$user1.CustomSecurityAttributes
129-
```
112+
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.
130121

131122
#### Assign a custom security attribute with a multi-string value to a user
132123

@@ -168,25 +159,18 @@ $attributesUpdate = @{
168159
Set-AzureADMSUser -Id dbb22700-a7de-4372-ae78-0098ee60e55e -CustomSecurityAttributes $attributesUpdate
169160
```
170161

171-
## Microsoft Graph API
172-
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).
174-
175162
#### Get the custom security attribute assignments for a user
176163

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.
178165

179-
```http
180-
GET https://graph.microsoft.com/beta/users/{id}?$select=customSecurityAttributes
166+
```powershell
167+
$user1 = Get-AzureADMSUser -Id dbb22700-a7de-4372-ae78-0098ee60e55e -Select CustomSecurityAttributes
168+
$user1.CustomSecurityAttributes
181169
```
182170

183-
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
184172

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).
190174

191175
#### Assign a custom security attribute with a string value to a user
192176

@@ -353,6 +337,61 @@ PATCH https://graph.microsoft.com/beta/users/{id}
353337
}
354338
```
355339

340+
#### 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+
356395
#### Remove a single-valued custom security attribute assignment from a user
357396

358397
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.
@@ -397,42 +436,6 @@ PATCH https://graph.microsoft.com/beta/users/{id}
397436
}
398437
```
399438

400-
#### 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-
436439
## Frequently asked questions
437440

438441
**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
470473
## Next steps
471474

472475
- [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)
474477
- [Troubleshoot custom security attributes in Azure AD](../fundamentals/custom-security-attributes-troubleshoot.md)

articles/active-directory/fundamentals/custom-security-attributes-add.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,5 +590,5 @@ No, you can't delete custom security attribute definitions. You can only [deacti
590590
## Next steps
591591

592592
- [Manage access to custom security attributes in Azure AD](custom-security-attributes-manage.md)
593-
- [Assign or remove custom security attributes for a user](../enterprise-users/users-custom-security-attributes.md)
594-
- [Assign or remove custom security attributes for an application](../manage-apps/custom-security-attributes-apps.md)
593+
- [Assign, update, list, or remove custom security attributes for a user](../enterprise-users/users-custom-security-attributes.md)
594+
- [Assign, update, list, or remove custom security attributes for an application](../manage-apps/custom-security-attributes-apps.md)

articles/active-directory/fundamentals/custom-security-attributes-manage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,5 @@ The following screenshot shows an example of the audit log. To filter the logs f
198198
## Next steps
199199

200200
- [Add or deactivate custom security attributes in Azure AD](custom-security-attributes-add.md)
201-
- [Assign or remove custom security attributes for a user](../enterprise-users/users-custom-security-attributes.md)
201+
- [Assign, update, list, or remove custom security attributes for a user](../enterprise-users/users-custom-security-attributes.md)
202202
- [Troubleshoot custom security attributes in Azure AD](custom-security-attributes-troubleshoot.md)

articles/active-directory/fundamentals/custom-security-attributes-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,4 @@ Depending on whether you have an Azure AD Premium P1 or P2 license, here are the
202202

203203
- [Add or deactivate custom security attributes in Azure AD](custom-security-attributes-add.md)
204204
- [Manage access to custom security attributes in Azure AD](custom-security-attributes-manage.md)
205-
- [Assign or remove custom security attributes for a user](../enterprise-users/users-custom-security-attributes.md)
205+
- [Assign, update, list, or remove custom security attributes for a user](../enterprise-users/users-custom-security-attributes.md)

articles/active-directory/fundamentals/custom-security-attributes-troubleshoot.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.service: active-directory
88
ms.subservice: fundamentals
99
ms.workload: identity
1010
ms.topic: how-to
11-
ms.date: 01/14/2022
11+
ms.date: 02/20/2023
1212
ms.collection: M365-identity-device-management
1313
---
1414

@@ -90,7 +90,7 @@ There are no custom security attributes defined and assigned yet for your tenant
9090

9191
**Solution 3**
9292

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 or 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).
9494

9595
## Symptom - Custom security attributes cannot be deleted
9696

@@ -140,6 +140,26 @@ You are not assigned the required custom security attribute role to make the API
140140

141141
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).
142142

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+
![Screenshot of Graph Explorer with ConsistencyLevel header added.](./media/custom-security-attributes-troubleshoot/graph-explorer-consistency-level-header.png)
162+
143163
## Next steps
144164

145165
- [Manage access to custom security attributes in Azure AD](custom-security-attributes-manage.md)
Loading

0 commit comments

Comments
 (0)