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 Answers 2

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 } 
4
  • Thanks @newbie what value to provide in $UserValue? Commented Nov 30, 2018 at 6:48
  • You can you a user column type. Such as Author or Editor columns for a list item. Commented Nov 30, 2018 at 8:22
  • This is not CSOM though... Commented Nov 30, 2018 at 9:25
  • Ooops yea. I saw PowerShell SharePoint-Server labels :/ Commented Nov 30, 2018 at 9:53

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.