0

We have a list with around 900 items, and recently the end-users decided to enable "Audience Targeting" on it. This added a new Audience Targeting column. The users now want to assign a default audience to many of the fields, and obviously they do not want to go through the entire collection and change them one by one. We tried to edit this column using a datasheet view without success (we got a nice "The selected cells are read-only" error -- I assume it is because the field type..)

Is it any way I could "batch update" that column in some of the items using a PowerShell script? Any other way to accomplish this?

Many thanks in advance,

Jose Parra

1
  • Jose - did you determine a way to do this? I've tried using direct query via Access and cannot update the field. Thanks.
    – user11136
    Commented Oct 4, 2012 at 15:59

1 Answer 1

0

You can update using powershell.

$context = Get-SPServiceContext $site
$am = New-Object Microsoft.Office.Server.Audience.AudienceManager($context)
$item = $list.Items[1]
#Setting audience
$item["Target Audiences"] = $am.GetAudience("MyAudiences").AudienceID.ToString() + ";;;;"
#Setting SPGroup
$item["Target Audiences"] = ";;;;Home Owners,Home Visitors"

Look at this post for more info.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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