?
Solved

How can I get all document metadata and column information from a document library in SharePoint Foundation 2010

Posted on 2014-12-30
4
Medium Priority
?
577 Views
Last Modified: 2015-01-06
I was able to get the list data but it doesn't include the column information about each document.

$web - get-SPWeb "http://sharepoint"
$list - $web.Lists["documentation"]
$item = $list.Items
$item | select  | Export-CSV C:\spinfo12-30.csv

However it only had some of the fields I needed (URL, Name).  In our SharePoint we have several document library specific columns in addition to the out of the box ones that store information about each document.  I need to get Title, Business Area, Category, Store, Region, Doc Type, Created By, Modified By and Checked Out to, Editor, Edit Date, Author.

Where are these stored and how do I access them via powershell?
0
Comment
Question by:CnD_IT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Ammar Gaffar
ID: 40525060
Check you document library default view, if it is contains the columns you are looking for (Title, Business Area, Category, Store, Region, Doc Type, Created By, Modified By and Checked Out to, Editor, Edit Date, Author), if not then edit the view by selecting all columns you need and try the same power shell commands again.

Good Luck
0
 
LVL 8

Accepted Solution

by:
Jayaraja Jayaraman earned 2000 total points
ID: 40533962
With the script below you can easy export all column in a list a comma seperates file

Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue -WarningAction SilentlyContinue | Out-Null

$url = "<site url>"
$listName = "<list name>"
$path ="c:\Columns.csv"

$web = Get-SPWeb $url
$list = $web.Lists.TryGetList($listName)
$list.ContentTypes | % { $_.FieldLinks } | select Name |  Export-Csv -path $path

To export all internal name of fields in a list you can change the last line into

$list.Fields | select InternalName  |  Export-Csv -path $path
0
 
LVL 8

Expert Comment

by:Jayaraja Jayaraman
ID: 40533964
0
 

Author Closing Comment

by:CnD_IT
ID: 40534021
Thank you!  I was also able to get what I needed from going to the library in SharePoint and exporting to excel.  I then copied/pasted to a separate worksheet so I could modify the location of the columns to suit my needs.  I will keep the above query handy for the future!!  Thanks,
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question