Changing user settings or profile information
This recipe describes how to change settings or profile information for a user in Microsoft 365 using the Microsoft Graph PowerShell SDK. Updating user details such as job roles or personal information is a common task for administrators.
Getting ready
Follow the guidance in the Setting up PowerShell recipe from Chapter 1, Microsoft 365 Setup and Basic Administration, to connect to your Microsoft 365 tenant via PowerShell. Ensure you have administrative privileges on your system, as well as administrative permissions to modify user profiles in your Microsoft 365 tenant such as User Administrator or Global Administrator.
How to do it…
Execute the Update-MgUser
cmdlet to modify user settings. For example, to update a user’s job title and department, use the following:
Update-MgUser -UserId "eottens@natechamberlain.com" -JobTitle "Senior Manager" -Department "Marketing"