Issue when tryng to get custom security attributes from Powershell, works with Azure AD

CADET Anthony 21 Reputation points
2022-12-14T12:49:15.737+00:00

Hi,

I have an issue when I try to use custom security attributes.
I created my attribute set with 2 attributes into it.
When i affect one of these attribute on someone with a predefined value, i can see this value on the Azure AD portal.
When I try to get this information using PowerShell I am not able to see anything.
Do you have any idea from where this issue can be ?
Thanks,
Anthony

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,684 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,957 questions
{count} votes

Accepted answer
  1. Harpreet Singh Matharoo 8,376 Reputation points Microsoft Employee Moderator
    2022-12-15T11:58:09.93+00:00

    Hello @CADET Anthony

    Thank you for reaching out. You can view Custom Security Attributes assigned to user using following ways:

    Azure Portal

    • Navigate to Users and select the user.
    • Select the Custom security attributes (preview) blade.

    PowerShell

    • First, place the objectId of the user into the $userId object..
    • Then view the customSecurityAttributes on that user.
    • Next, save the customSecurityAttributes of that user to and object called $userCSA.
    • Finally, view the AdditionalProperties of the customSecurityAttributes for the user. Connect-MgGraph
      Select-MgProfile -Name beta
      $userId = 'ObjectId_of_user>'
      Get-MgUser -UserId $userId -Property "customSecurityAttributes" | select -ExpandProperty customSecurityAttributes | fl
      $userCSA = Get-MgUser -UserId $userId -Property "customSecurityAttributes"
      $userCSA.CustomSecurityAttributes.AdditionalProperties | fl

    Microsoft Graph API

    URI: https://graph.microsoft.com/beta/users/<id>?$select=customSecurityAttributes

    The response will look like this if there are no custom security attributes assigned to the user:
    271017-image.png

    For more details you can review following document: Assign, update, list, or remove custom security attributes using the Microsoft Graph API (preview)

    I hope this helps.

    ----------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. CADET Anthony 21 Reputation points
    2022-12-15T13:41:51.733+00:00

    Hello !

    Thanks a lot @Harpreet Singh Matharoo !

    Anthony

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.