in the previous article you have learn, Create Bulk user in office 365 admin center. In this article you will learn to update method to update Contact Information in bulk using PowerShell.
You can achieve from AzureAD and Microsoft Graph and in this article you will understand how to update user properties in bulk using Microsoft Graph.
Before running PowerShell script to edit, you need to check if Microsoft graph is installed, if you do not found installed the Microsoft graph module.
Check if installed
Get-InstalledModule Microsoft.Graph
Install Microsoft Graph
Install-Module Microsoft.Graph -Scope CurrentUser
install if not already, connect your Microsoft graph using below PowerShell command, enter your credentials and proceed.
Connect-MgGraph -Scopes “User.ReadWrite.All”

grant access with permission which can modify your tenant (Read Write)

Here, Microsoft Graph is connected with required permission

Now, You need to understand the format in which all the user data will be arranged. sample is below for your information. in this sample i will be using csv format

Open your PowerShell recently connect to Microsoft Graph and paste the script after changing the script path where it is located in your local computer.
$CSVPath = “C:\Script\contact.csv”
$users = Import-Csv -Path $CSVPath
foreach ($user in $users) {
$UPN = $user.UserPrincipalName
$Dept = $user.Department
$OfficeLocation = $user.Office
Write-Host “Updating user: $UPN with Department: $Dept and Office: $OfficeLocation”
Update-MgUser -UserId $UPN -Department $Dept -OfficeLocation $OfficeLocation
}
After running the command in the graph connected PowerShell refresh you browser and go to office 365 admin and check the status if the users are being reflected. Please refresh the page before checking the status.
Conclusion!!!
In this article you have learn, how to update bulk contact in office 365 admin center. in the next article you will be learning how to setup services account in office 365 for Sending emails using application which means SMTP.