3

Any having experience with SharePoint 2010 and updating the user profiles properties (via managed code/PowerShell)? We have some problems setting values to a multivalued property. We have tried managed code as well as PowerShell but can’t set the multivalued properties. See below links:

http://msdn.microsoft.com/en-us/library/ms546301(v=office.14).aspx

http://get-spscripts.com/2010/07/modify-multi-value-user-profile.html

Thanks in advance

2

This is a really good question, which I find not to be covered that often.

The whole theory of how to get around it is:

$foo = Get-Record
$bar = "value and type of the target field collection"
$foo.SomeField += $bar
$foo | Set-Record

This is a general PowerShell example and would work with any multivalue field inside or outside of SharePoint.

I found a good example for SharePoint on msdn via google:

foreach($p2 in $_.Item($p).GetTaxonomyTerms())
{
    #valueType: $_.Item($p).Value.GetType() reports as a Taxonomy.Term
    $arProfileProps2 += $p2.Name.ToString();
}

Source here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.