Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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