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
314 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
  • 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 500 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now