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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Call to SQL server times out 5 48
TSQL remove duplicates from different columns 14 47
Complex SQL Server WHERE CLause 9 35
get count of orders by customer Sql Server table. 3 41
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.

740 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