However, this approach is inefficient and too time consuming (especially when dealing with thousands of profiles).
Many enterprises need to replicate custom attributes to the Share Point user profile service and so a more performant user profile bulk API has been released.
This requires that the updated CSOM redistributable package has been installed on the computer where the script is executed. In the picture below, you can see two sub folders for two different executions created in the document library where the import file is stored: The actual log file is saved in the sub folder and you can download that from Office 365 for detailed analysis: Following table contains typical exceptions which you could encounter when you start using the User Profile Service bulk API. The API will validate that all properties currently being mapped are NOT user editable.
By using Power Shell, you do not need to compile your code within Visual Studio, which may be a more suitable model for some customers. The exception will point out the property which cannot be used.
For the list of these core directory properties, see the table listed in the FAQ section below.
Below is a brief video that demonstrates using the new CSOM API from both managed code (. You can find the sample code used, including the sample Power Shell script, in the Office Dev Pn P Code Gallery.
There are few restrictions on individual source data files: object.
These must be synchronized to Azure Active Directory.
The key is the property name used in the source file, the value is the property name used in the User Profile Service.
source Uri: The URI of the source data file to import.
Below is a sample Power Shell script which performs the same operations as the code above: # Get needed information from the end user $admin Url = Read-Host -Prompt ' Enter the admin URL of your tenant' $user Name = Read-Host -Prompt ' Enter your user name' $pwd = Read-Host -Prompt ' Enter your password' -As Secure String $import File Url = Read-Host -Prompt ' Enter the URL to the file located in your tenant' # Get instances to the Office 365 tenant using CSOM $uri = New-Object System. In this example, we have tried to map a JSON property to the The JSON data file contained a property which has not been mapped to the User Profile Service property in Share Point Online.
Uri -Argument List $admin Url $context = New-Object Microsoft. This means that the source data file contains properties for which you have not provided a mapping in the The data file contained an identity, which could not be resolved or was not present in the User Profile Service.
Yes, you’ll need to register the client id and secret to be able to execute the APIs.