Delete Employee hire date attribute

Lukas Kaminskas 20 Reputation points
2023-10-04T09:43:29.5733333+00:00

Hello,

I need to remove "Employee hire date" attribute. I can only change date. Is it possible to disable it?

Untitled

Microsoft Security | Microsoft Entra | Microsoft Entra ID
0 comments No comments
{count} votes

Accepted answer
  1. Alfredo Revilla - Upwork Top Talent | IAM SWE SWA 27,526 Reputation points Moderator
    2023-10-04T23:54:44.73+00:00

    Hello @Lukas Kaminskas , you can use the Microsoft Graph API to clear the employeeHireDate property. Follows a sample script. You will need to install the PowerShell SDK and MSAL.PS.

    Connect-MgGraph -AccessToken `
    (    (Get-MsalToken -ClientId 14d82eec-204b-4c2f-b7e8-296a70dab67e  `
                -Scopes  "User.ReadWrite.All" -TenantId $TenantId ).AccessToken |
        ConvertTo-SecureString -AsPlainText -Force)
    
    Invoke-MgGraphRequest -Method PATCH -Uri "https://graph.microsoft.com/v1.0/Users/$UserId" `
        -Body @{ EmployeeHireDate = $null }
    

    Let us know if you need additional assistance. If the answer was helpful, please accept it and rate it so that others facing a similar issue can easily find a solution.

    1 person 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.