Jan 31 2018
06:51 AM
- last edited on
Feb 01 2023
01:45 PM
by
TechCommunityAP
Jan 31 2018
06:51 AM
- last edited on
Feb 01 2023
01:45 PM
by
TechCommunityAP
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)
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
Jan 31 2018 10:34 AM
SolutionIt'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.
Feb 01 2018 12:24 AM - edited Feb 02 2018 01:33 AM
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
Jan 31 2018 10:34 AM
SolutionIt'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.