kwizcom banner advertisement

Get List Fields in SharePoint using PowerShell

Requirement: Get all Fields from a SharePoint list using PowerShell.

PowerShell Script to get all List Fields, Internal Name and Field types:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Configuration Parameters
$SiteURL="http://intranet.crescent.com/"
$ListName= "Quick Links"

#Get the List
$List = (Get-SPWeb $SiteURL).Lists.TryGetList($ListName)

Write-Host "Field Name | Internal Name | Type"
Write-Host "------------------------------------"

#Loop through each field in the list and get the Field Title, Internal Name and Type
ForEach ($Field in $List.Fields)
{
    Write-Host $Field.Title"|"$Field.internalName"|"$Field.Type
}  
This PowerShell script gets all column names, internal name and column types from the given SharePoint list!
sharepoint powershell get list columns
Get List Fields in SharePoint using PowerShell Get List Fields in SharePoint using PowerShell Reviewed by Salaudeen Rajack on 1:08 PM Rating: 5

2 comments:

  1. Nice Post and Code.. it saved my Time

    ReplyDelete
  2. Hi,
    How we can get the searchable columns list as a report like web application or sub site level? I searched the properties but not getting. Any suggestion!!

    ReplyDelete

Please Login and comment to get your questions answered!

Powered by Blogger.