Get Value from People Picker in SharePoint Online with PowerShell

Get Value from People Picker in SharePoint Online with PowerShell

When using SharePoint Online as an input for our PowerShell scripts, sometimes we need to get information from a People Picker type of field. Luckily this is pretty easy to do once you know where to look at.

First of all, you will need to use CSOM to get this property, as the Out of the Box SharePoint Online cmdlets to not allow you to do anything under the SPWeb. If you are an IT Pro, you might find PowerShell and CSOM a bit harder to understand and that’s normal. Chris O’Brien has a great blog post to get you started on Using CSOM in PowerShell scripts with Office 365

Whenever we simply want a string from SharePoint Online, we simply use $item[“ColumnName”] and it works. However that returns nothing for a People Picker Column. For a People Picker Column, here is a screenshot of what properties look like.

Get Value from People Picker in SharePoint Online PowerShell

So if you need the Email, you simply use: item[“ColumnName”].Email . If you want the name, you would use $item[“ColumnName “].LookupValue

Get Value from People Picker in SharePoint Online PowerShell

I hope this was helpful! If you want to learn more about PowerShell for Office 365, check out my Pluralsight course by clicking the banner below!

Learn PowerShell for Office 365

4.88/5 (8)

Please rate this

 
Comments

No comments yet.

Leave a Reply