Solved

Get documentset fields in powershell

Posted on 2013-05-19
4
680 Views
Last Modified: 2013-05-20
I am using the following powershell to add an entry to my document set.

$web = Get-SPWeb http://mysp/products  
$list = $web.Lists["RMSpecs"]    
$cType = $list.ContentTypes["RM Spec"]    
[Hashtable]$docsetProperties = @{"RMCode"="MyRM";"RMDescription"="myStuff"}
$newDocumentSet = [Microsoft.Office.DocumentManagement.DocumentSets.DocumentSet]::Create($list.RootFolder,"My Title",$cType.Id,$docsetProperties) 

Open in new window


I end up with a new documentset in my libruary called "My Title" as expected, but the other fields I was trying to populate (RMCode and RMDescription) are blank.

How do I find out the names for these fields?     or
What am I doing wrong?

Thanks.
0
Comment
Question by:Gary_Brown_Applied
4 Comments
 
LVL 5

Expert Comment

by:milindsaraswala
Comment Utility
Use U2U Camel Query Builder to find out the exact name of the fields which you are using
0
 
LVL 29

Expert Comment

by:QPR
Comment Utility
try ows_RMCode and ows_RMSDescription
Failing that, try sharepoint manager or other to get the true internal names
0
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 500 total points
Comment Utility
Hi,
you can use this Powershell script to get both the title and the internal name of the fields - just adjust the site url and the list name:
$siteUrl = "http://dev.rainerj.local/sites/ee/"
$listName = "EEReorderFields"
$site= New-Object Microsoft.SharePoint.SPSite ($siteUrl) 
$web=$site.OpenWeb() 
$list=$web.Lists[$listName] 
$list.Fields |select ID, title, internalname | Sort-Object title

Open in new window


@QPR: the "ows_" are the names which are returned when you use the lists web service.

HTH
Rainer
0
 

Author Closing Comment

by:Gary_Brown_Applied
Comment Utility
Thanks Rainer, showed me exactly what I needed to know.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
I recently came across an issue with a MOSS 2007 deployment where access into some sub-sites were denied, even for the MOSS farm administrators. A bit of background to the setup of this MOSS farm; this was a three server setup, consisting of a fr…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

10 Experts available now in Live!

Get 1:1 Help Now