Hi @Smith88 ,
Here are some suggestion based on the query in the question.
- User Information is a SharePoint system list, it will add user automatically once the user is resolved in any People Picker. It's not supported to update the user object directly in this list.
- To update person field in SharePoint List Items, it needs to get the User object firstly using $web.EnsureUser and then update, please refer the following script: Update Single Value Person field:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue $SiteURL = "http://sp2016/sites/dev" $ListName = "Employee" $FieldName="MyPerson" $web = Get-SPWeb $SiteURL $list= $web.lists[$listName] $ListItem = $List.GetItemByID(3) $UserAccount="contoso2016\Jerry" #Get the User $User=$web.EnsureUser($UserAccount) $UserFieldValue = new-object Microsoft.SharePoint.SPFieldUserValue($web, $User.ID, $User.LoginName) $ListItem[$FieldName] = $UserFieldValue $ListItem.Update()
Update Multiple value Person field:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$SiteURL = "http://sp2016/sites/dev"
$ListName = "Employee"
$FieldName="MulPerson"
$web = Get-SPWeb $SiteURL
$list= $web.lists[$listName]
$ListItem = $List.GetItemByID(3)
$UserAccounts="Contoso2016\Jerry;Contoso2016\bk"
$UserAccountsColl = $UserAccounts -split ';'
[Microsoft.SharePoint.SPFieldUserValueCollection] $UserCollection = new-object Microsoft.SharePoint.SPFieldUserValueCollection
foreach($UserAccount in $UserAccountsColl)
{
$User=$web.EnsureUser($UserAccount)
$UserFieldValue = new-object Microsoft.SharePoint.SPFieldUserValue($Web, $User.ID, $User.LoginName)
$UserCollection.Add($UserFieldValue)
}
#update the Multiple value Person or Group field
$ListItem[$FieldName] = $UserCollection
$ListItem.Update()
Reference:
Get-Set Person or Group (People Picker) Field Value using PowerShell in SharePoint
Thanks
Best Regards
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.