our current on-prem enviorment uses a external field to hold the employees birthday, this is then mapped to SPS-Birthday (on-prem). We have a SP Online instance to and I would like to get this birthday field to the online instance as well. I have exported a JSON list of the user account and the property field I need from SharePoint 2016 however I am struggling to import this into SharePoint Online with the provided API. The modified powershell runs successfully however the field is not being updated:
$adminUrl = "...admin.sharepoint.com"
$userName = "..."
$pwd = Read-Host -Prompt 'Enter your password' -AsSecureString
$importFileUrl = "...Test%20Document%20Library/sample.txt"
$uri = New-Object System.Uri -ArgumentList $adminUrl
$context = New-Object Microsoft.SharePoint.Client.ClientContext($uri)
$context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $pwd)
$o365 = New-Object Microsoft.Online.SharePoint.TenantManagement.Office365Tenant($context)
$context.Load($o365)
$userIdType=[Microsoft.Online.SharePoint.TenantManagement.ImportProfilePropertiesUserIdType]::Email
$userLookupKey="IdName"
$propertyMap = New-Object -type 'System.Collections.Generic.Dictionary[String,String]'
$propertyMap.Add("Property1", "Office")
$propertyMap.Add("Property2", "SPS-Birthday")
$workItemId = $o365.QueueImportProfileProperties($userIdType, $userLookupKey, $propertyMap, $importFileUrl);
$context.ExecuteQuery();
Write-Host "Import job created with following identifier:" $workItemId.Value
This is the sample file being used, I have tried using Birthday in 2 different formats and still nothing.
{
"value": [
{
"IdName": "email1@.com",
"Property1": "JHB",
"Property2": "1/11/2016 12:00:00 AM"
},
{
"IdName": "email2@.com",
"Property1": "JHB",
"Property2": "1/13/2016 12:00:00 AM"
},
{
"IdName": "email3@.com",
"Property1": "JHB",
"Property2": "January 14"
}
]}
Really come to a roadblock with this and the help would be greatly apriciated please guys. Regards.