Get “Created By” User Email, Display Name, Login ID in SharePoint using PowerShell

Requirement:
Sometimes, You may have to retrieve the user details such as the User’s Email, Account ID, Full name, etc., from the Created by field. Here is the PowerShell script to get created by field values in SharePoint.

PowerShell to Get “Created By” Field Value in SharePoint:

Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue
 
#Configuration Parameters
$WebURL = "https://portal.crescent.com/IQ/"
$ListName = "Questionnaire"
$ItemID = "147"
 
#Get the Web, List, Item objects
$Web= Get-SPWeb $WebURL
$List= $web.Lists[$ListName]
$Item = $List.GetItembyID($ItemID)
 
#Get the "created by" Field value
$Author = New-Object Microsoft.SharePoint.SPFieldUserValue($web, $Item["Author"])

#Get Email ID from Created By
$Author.user.Email
#Get Login ID
$Author.User.LoginName
#Get Created By Full Name
$Author.User.Name

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *