How to Set People Picker value in SharePoint using CSOM and Powershell?
Hello SharePointers,
Below are the CSOM script to set/populate People Picker value in a SharePoint list .
$userName = “domain\username”
$spuser = EnsureUser $context $userName
$lookupValue = @()
if($spuser -ne $null){
$spuserValue = New-Object Microsoft.SharePoint.Client.FieldUserValue
$spuserValue.LookupId = $spuser.id
$lookupValue += $spuserValue
}
$userValue = [Microsoft.SharePoint.Client.FieldUserValue[]]$lookupValue
$listItem[“Your People Picker FieldColumn name”] = $userValue
$listItem.Update()
Happy SharePointing Folks 🙂