Note: The implementation of this feature will require advanced technical skills and administrative access. Please consult a member of your IT team with administrative privileges to carry out the instructions detailed below.
While it is possible to make manual adjustments to all available user attributes on Teamflect, making changes to some of the attributes stored on Microsoft 365 will require taking manual action. Birthday is one such attribute. Although it is currently not possible to change the birthday attribute using the standard user menus available on Microsoft 365, Azure Portal or Entra ID, it is possible to change it by using Graph API. This article will address the necessary dependencies, steps, permissions and show you how to use Graph API through PowerShell.
Step 1: Install PowerShell
If you do not have PowerShell installed on your system, follow these instructions to download and install it: Install PowerShell.
Step 2: Install the Microsoft Graph PowerShell SDK
Microsoft Graph PowerShell SDK is required to interact with Microsoft Graph via PowerShell. Follow the installation guide here: Install Microsoft Graph PowerShell SDK.
Step 3: Launch PowerShell and connect to Graph API
Run PowerShell as an administrator. To connect to GraphAPI with the necessary permissions, use the following command line.
Connect-MgGraph -Scopes "User.ReadWrite.All","Sites.ReadWrite.All"
The User.ReadWrite.All permission will allow us to make changes to your user properties. The Sites.ReadWrite.All permission is necessary to access the Birthday property, as it is stored on SharePoint. For more information, you can consult the Microsoft Graph permissions reference.
Upon using the command line, you will be taken to a log-in page where you will be able to grant the necessary permissions. After granting the permissions, you will be directed back to PowerShell.
Step 4: List users
If you don't know the ID of your desired user, you can use the command below to get a list of your Graph users:
MgUser
Step 5: Change the Birthday attribute
After finding the ID of your user, you can use the following command to update their birthday property:
Update-MgUser -UserID 'insert your user ID here' -Birthday 'insert the birthdate here'
The date of birth will need to be in ISO 8601 format and will always be in UTC time. For example, midnight UTC on November 18th, 2024 is:
2024-11-18T00:00:00Z
Tip: You can replace the "-Birthday" property with "-EmployeeHireDate" to use the same command structure to update user's employee hire date property instead.
After executing the command, you will be able to see the updated birthdate on Teamflect's Admin Centre. If the data is not updated immediately, it will be updated shortly upon synchronisation.