Link to home
Start Free TrialLog in
Avatar of NicksonKoh
NicksonKohFlag for Singapore

asked on

Powershell Script to extract metadata of records in document library

Hi Experts,

I am writing a powershell script to read the metadata of all records in document library in SharePoint 2007.

I am able to read the records but could not figure out how to read the values. Pls help.

rgds,
Nickson
Avatar of Justin Smith
Justin Smith
Flag of United States of America image

2010 version....

$web=Get-SPWeb http://
$list=$web.Lists["name of list"]
$list.Items | select Title, DisplayName


The select statement is where you select what columns you want to pull back.  If you want them all, put "*"
ASKER CERTIFIED SOLUTION
Avatar of slidingfox
slidingfox
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NicksonKoh

ASKER

Thx Fox. The code looks great.

I tried and am getting the error at line 6
"$object | Add-Member -MemberType NoteProperty -Name 'Title' -Value $item["Name"]"

Cannot index into a null array.
At D:\Batch Jobs\PowerShell Scripts\Useful Scripts\List Value of Items in a List.ps1:11 char:78
+     $object | Add-Member -MemberType NoteProperty -Name 'Title' -Value $item[ <<<< "Name"]
    + CategoryInfo          : InvalidOperation: (Name:String) [], RuntimeException
    + FullyQualifiedErrorId : NullArray
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Works Fantastic!