I need urgent help in updating/adding the usagelocation of office 365 user into the office Location (sps-location) under user profile of Sharepoint Online.
I have been trying the script mentioned here:https://github.com/SharePoint/PnP/blob/master/Samples/UserProfile.BatchUpdate.API/CreateImportJob.ps1
Exception calling "ExecuteQuery" with "0" argument(s): "URL is not for this web"
At C:\Users\gsjolly\Documents\pnpapi.ps1:65 char:1
+ $context.ExecuteQuery();
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ServerException
Import job created with following identifier: 00000000-0000-0000-0000-000000000000
In above command, I have saved the sample JSON file in my sharepoint site as sample.txt. I also tried with sample.json, but still I get the same error.
I have also tried the script mentioned in:
https://www.c-sharpcorner.com/article/update-user-profile-properties-from-sharepoint-using-csom-po/
This script does not gives me the error but it also does not update or do anything.
any help would be much appreacited