none
Bulk upload SharePoint user profile field RRS feed

  • Question

  • Hi,

    I'd like to bulk update a custom user property for a list of users in the SharePoint user profile.

    I managed to import the csv file but failed to run the foreach line to update the field.

    Can anyone shed some light?

    Many thanks.

    • Moved by Bill_Stewart Wednesday, November 29, 2017 6:47 PM Unanswerable drive-by question
    Friday, October 20, 2017 9:18 AM

All replies

  • On what?  We cannot guess at what you are doing.

    \_(ツ)_/

    Friday, October 20, 2017 11:12 AM
  • Hi jrv, 

    Do you have any insights on how to build a script for updating one of the custom field for a list of users?

    Below is my script that I have been trying to build but failed to use the Set-MsolUser command

    $adminUPN="xxx@xxx.com"
    $userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
    Connect-SPOService -Url https://xxx-admin.sharepoint.com -Credential $userCredential
    $MySiteURL = "https://xxx-my.sharepoint.com"

    $list = import-csv C:\temp\Update.csv

    $list | foreach {Set-MsolUser -UserPrincipalName $_.UserPrincipalName -CustomField $_.CustomField}

    Many thanks.

    Monday, October 23, 2017 2:02 AM