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
376 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

828 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