Set "Employee type" from powershell

Ivan Baranov 41 Reputation points
2022-09-13T06:34:11.117+00:00

Hello!

In the Web UI of the Azure AD we have the field "Employee type", we can set the value from the Web UI just fine.
However when we try to access this attribute via the Get-AzureADUserExtension it doesn't seem to exist

'Get-AzureADUserExtension -ObjectId UUID'

How can we get/set value for this attribute in PowerShell?

Microsoft Security Microsoft Entra Microsoft Entra ID
{count} votes

Accepted answer
  1. Harpreet Singh Matharoo 8,396 Reputation points Microsoft Employee Moderator
    2022-09-13T08:44:32.24+00:00

    Hello @Ivan Baranov

    I would like to share following details with you with regards to Employee Type attribute.

    Scenario 1: Update Employee Type Attribute on Sync'd users

    • Employee Type would be sync’d to Azure AD as an extension attribute.
    • This Attributes would not be visible on GUI.
    • You would need to use Graph to query and view these attributes on the users.
    • Below is the screenshot which confirm the successful sync to Azure AD.
      240434-image.png

    Scenario 2: Update Employee Type Attribute on Cloud Only Users

    • Employee Type Attribute is a editable field for cloud only users.
    • Employee Type Attribute is not exposed to Azure AD PowerShell module and needs to be managed either from Portal or using Microsoft Graph explorer or Graph PowerShell.

    Steps to edit EmployeeType attribute for cloud only users with Microsoft Graph PowerShell:

    Connect-MgGraph -Scopes User.ReadWrite.All  
    Select-MgProfile -Name beta  
    Get-MgUser -UserId ******@contoso.com | Select -Property EmployeeType  
    Update-MgUser -UserId ******@contoso.com -EmployeeType FTE  
    

    Steps to edit EmployeeType attribute for cloud only users with Microsoft Graph Explorer:

    • Browse to https://aka.ms/GE
    • Make sure you have required permissions.
    • To get execute the following GET query: https://graph.microsoft.com/beta/users/<Add Object-ID or UPN>
    • To update EmployeeType attribute execute following PATCH Query with JSON body having attribute name and value as shown in below screenshot:
      240477-image.png

    I hope this helps to resolve your query.

    ----------

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

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

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.