SharePoint: Get SPField details for SharePoint Lists using PowerShell

I have seen multiple posts on different forums to get details of list columns (like field type) for all SharePoint Lists or any specific list. I also uploaded script to Technet document gallery . This PowerShell script will show the fields defined in list Views. But with a little modification in code you can get details of all fields associated with SharePoint List.
There are two functions in attached PowerShell script:

This function takes one parameter (Site URL), and will print all fields in SharePoint site associated with list views.

Function Call: Function can be called as GetSPFieldDetailsForAllLists http://<siteURL>

This function takes two parameter (Site URL & List name). It’s functionality is same as of GetSPFieldDetailsForAllLists but it will print field details of only single list which is passed as parameter.

Function Call: Function can be called as GetSPFieldDetailsForList http://<siteURL> <List Name>

Get Details of all fields associated with SharePoint List:
With a little modification in above code, you can get details of all fields associated with List. In above code snippet I have used fields for List view only. For fetching all list fields, you will need to do below modification.

The following two tabs change content below.
Adnan Amin
Adnan is two time SharePoint MVP (Most Valuable Professional) with over 12 years of extensive experience with major expertise on SharePoint Server, Office 365, .Net Platform and Microsoft BI. He is currently working SharePoint Architect at FMT Consultants. He is MCT Regional Lead for Pakistan Chapter since 2012. He is working on SharePoint for past nine years and worked on different intranet/intranet solutions for private & govt. sector majorly in Gulf region, which include OOB and customized solutions. He is a trainer, technology evangelist and also speaks in community forums.

Leave a Reply