Others

How to Update EmployeeHireDate for Multiple Users with PowerShell

Huma Ashraf ChHuma Ashraf Ch Oct 15, 2026 870 views

Question details

The user needs a PowerShell script to read employee data from a CSV file and perform a bulk update on the EmployeeHireDate property for multiple users.

How to Update EmployeeHireDate for Multiple Users with PowerShell
Product
Microsoft Graph PowerShell
Device & OS
not provided
Scenario
Administrating user accounts and updating Active Directory employee records in bulk using data exported to a CSV file.
Observed behavior
The user needs to successfully map CSV data to specific user accounts using a reliable identifier like a UPN and apply the updated hire date.
Before you start

Ensure you have Microsoft Graph PowerShell installed, possess the necessary API permissions (such as User.ReadWrite.All), and verify your CSV file has clear headers for the user identifier and hire date.

Solution 1Recommended

Use Microsoft Graph PowerShell to Bulk Update from CSV

Leverage the Microsoft Graph PowerShell SDK to iterate through your CSV file and update each user's hire date efficiently.

Microsoft Graph is the modern and recommended approach for managing Microsoft 365 user properties. By combining the Import-Csv cmdlet with Update-MgUser, you can automate property updates across thousands of accounts securely.

1
Prepare the CSV file

Create a CSV file containing at least two columns: 'UserPrincipalName' (or ObjectID) and 'HireDate'. Ensure the dates are formatted correctly (e.g., YYYY-MM-DD).

2
Connect to Microsoft Graph

Open PowerShell as an Administrator and execute the command 'Connect-MgGraph -Scopes "User.ReadWrite.All"' to authenticate your session with the required privileges.

3
Run the update script

Use the following logic in your script: '$users = Import-Csv -Path "C:\path\to\file.csv"' followed by a loop: 'foreach ($user in $users) { Update-MgUser -UserId $user.UserPrincipalName -EmployeeHireDate $user.HireDate }'.

Use Microsoft Graph PowerShell to Bulk Update from CSV
Test your script: Always test your PowerShell script with a small, controlled group of pilot users to confirm the properties are updating correctly before running it against your entire directory.
Free Microsoft Office alternative

Manage Your CSV Data Seamlessly with WPS Office

While running PowerShell scripts requires Microsoft's specific IT administrative tools, preparing and cleaning the CSV files used for these bulk updates is effortless with WPS Office. It serves as a highly compatible, fast, and free alternative to Microsoft Excel for all your spreadsheet preparation needs.

  1. 1. Download WPS Office: Get the free WPS Office suite from the official website and install it on your computer.
  2. 2. Open your CSV file: Launch WPS Spreadsheet and open the CSV file containing your users' EmployeeHireDate data.
  3. 3. Edit and save: Update the headers and user data accurately, then save the file in CSV format to ensure it remains plain text for your PowerShell scripts.
Perfectly compatible with Microsoft Excel CSV, XLS, and XLSX formats.Free, lightweight, and opens large data sets lightning fast.Familiar user interface makes data cleanup and column mapping intuitive.
microsoft office alternative - wps office

Frequently Asked Questions

Can I update EmployeeHireDate using the older AzureAD PowerShell module?

Microsoft is deprecating the AzureAD module, so it is highly recommended to use the Microsoft Graph PowerShell SDK (Update-MgUser) to manage user properties like EmployeeHireDate moving forward.

What format should the hire date be in the CSV file?

Ensure the date in your CSV file is formatted in a standard ISO 8601 format (such as YYYY-MM-DD) or a recognizable standard date format so that Microsoft Graph can parse it correctly without regional format conflicts.

Why am I getting an 'Insufficient privileges' error when running the script?

This error occurs if your PowerShell session isn't authenticated with the necessary directory permissions. Ensure you run 'Connect-MgGraph -Scopes "User.ReadWrite.All"' and that your admin account is assigned the appropriate directory roles.