Friday 18 October 2019

How to bulk update user's manager from import CSV in O365?


Or, updating the bulk user's manager in O365 using CSV file

Steps/Prerequisites:
- Make sure you are corrected with O365 PowerShell session.
- Make sure you have exported Managers list in CSV format using the KB How to export user's managers in O365?

To update the user’s manager execute the below commands:

--------------------------------------------------------------------------------------------------------
$users = Import-Csv -Path "C:\manager.csv"
foreach($i in $users)
{
Set-User -Identity $i.UserprincipalName -Manager $i.Manager
}
---------------------------------------------------------------------------------------------------------

Note: Choose your correct file name and file path in the above-given command

Cheers, please write me back if you have any query or feedback.

How to export user's managers in O365?


Or, PowerShell command to export mailbox's managers in CSV format in O365

You can use the following command to export the user name along with the assigned manager details in .csv format.
------------------------------------------------------------------------------------------------
Get-user | select displayname, *manager* | Export-Csv -Path c:\managers.csv
-----------------------------------------------------------------------------------------------

Note: Please make sure you are connected to the O365 PowerShell session.

Cheers, please write me back if you have any query or feedback.