25,130 questions
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.