SOLVED

How to load managers for differents users from a csv file on Office 365 through Powershell?

Brass Contributor

Hi,

I'm trying to update through powershell, the line managers,  which are in a csv format , of all the employees working in our company.

I know how to do it manually (see the 4 steps below)

 

1)

2)

msoft2.png

 

3)

 

4)

But I'm clueless on how to do it by bulkload.

Update: I'm not looking for code rather for clues/links on how to do it.

 

Any tips are welcomed.

Cheers


PS: if my explanation was still unclear, please read this http://blog.goptg.com/blog/2011/09/06/set-up-manager-in-exchange-and-sharepoint-online-in-office-365


2 Replies
best response confirmed by Andy Kw (Brass Contributor)
Solution

It's a very simple task, all you need to do is use the Set-User cmdlet against the CSV file. For example:

 

Import-CSV blabla.csv | % { Set-User $_.UserPrincipalName -Manager $_.Manager }

 

where it is assumed that you have the blabla.csv file with column UserPrincipalName, uniquely designating the user, and column Manager.

Hi Vasil,

 

Thanks for the answer.

Not sure why but the UserPrincipalName option is not available.

 

First, you need to put the headers in the csv file like below, separated by comma

Identity,Manager
andy.k,BigBoss

Once done, I've amended the script a bit

 

Import-CSV blabla.csv|%{Set-User $_.Identity -Manager $_.Manager}

 

 

Cheers

1 best response

Accepted Solutions
best response confirmed by Andy Kw (Brass Contributor)
Solution

It's a very simple task, all you need to do is use the Set-User cmdlet against the CSV file. For example:

 

Import-CSV blabla.csv | % { Set-User $_.UserPrincipalName -Manager $_.Manager }

 

where it is assumed that you have the blabla.csv file with column UserPrincipalName, uniquely designating the user, and column Manager.

View solution in original post