1

I want to get the display name of created by and modified by fields for a user in a SharePoint 2013 List using CSOM in powershell.

I know that can be acheived by:

New-Object Microsoft.SharePoint.SPFieldUserValue()

But I want an alternative for that in CSOM powershell. Please assist.

2

In SharePoint CSOM, use Microsoft.SharePoint.Client.FieldUserValue class instead like this:

$owner = new-object Microsoft.SharePoint.Client.FieldUserValue($item["Owner"]).LookupValue
0

I'm using this for Author and Editor columns in a list.

function GetUserDisplayName($UserValue)
{
    $user = $web.SiteUsers.GetById($UserValue.Split(";#")[0]);      
    return $user.DisplayName
}
  • Thanks @newbie what value to provide in $UserValue? – Adarsh Awasthi Nov 30 '18 at 6:48
  • You can you a user column type. Such as Author or Editor columns for a list item. – newbie Nov 30 '18 at 8:22
  • This is not CSOM though... – Bunzab Nov 30 '18 at 9:25
  • Ooops yea. I saw PowerShell SharePoint-Server labels :/ – newbie Nov 30 '18 at 9:53

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.