The User Profile Service property used for the lookup depends on the value of A map from the source property name to the User Profile Service property name.Note that the User Profile Service properties must already exist.There are few restrictions on individual source data files: object.This is an asynchronous call in that it doesn’t download the source data or perform the import, it simply adds a work item to the queue for doing this later.Execute Query(); You can also check the status of the User Profile Service import jobs by using the new CSOM APIs. When you queue the import process with CSOM there will be an initial level of validation of the provided values.There are two new methods for this in the Tenant object. Load($o365) # Type of user identifier ["Email", "Cloud Id", "Principal Name"] in the User Profile Service $user Id Type=[Microsoft. This includes confirmation that the provided mapping properties exist in the User Profile Service and that these properties are not editable by the end user.Here’s the full signature of the method: The name of the id property in the source data.The value of the property from the source data will be used to lookup the user.
Email; // Name of the user identifier property within the JSON file var user Lookup Key = "Id Name"; var property Map = new System. Queue Import Profile Properties( user Id Type, user Lookup Key, property Map, file Url ); ctx. Import Profile Properties User Id Type]:: Email # Name of user identifier property in the JSON $user Lookup Key="id Name" # Create property mapping between the source file property name and the O365 property name # Notice that we have here 2 custom properties in UPA called ' City' and ' Office Code' $property Map = New-Object -type ' System. Value There are two levels of validation when this API is used.Below is an example using C# of how to start the process using the sample input file above: // Create an instance of the Office 365 Tenant object. Add("Office", "Office Code") # Call to queue UPA property import $work Item Id = $o365.Loading this object is not technically needed for this operation. Execute Query(); // Type of user identifier ["Principal Name", "Email", "Cloud Id"] in the // User Profile Service. Queue Import Profile Properties($user Id Type, $user Lookup Key, $property Map, $import File Url); # Execute the CSOM command for queuing the import job $context.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.Yes, you’ll need to register the client id and secret to be able to execute the APIs.Since the actual import of the file does not occur synchronously with the identity of the caller, this works without any issues.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.