I'm looking for a powershell script that allows me add metadata column in SharePoint list. Thanks
feedback
|
|
There is a neat blog post where this is mentioned with detailed steps and snapshots. Please refer - http://get-spscripts.com/2011/03/configuring-metadata-navigation.html EDIT: There is also a blog post which shows how managed metadata column is added using Client Object model in SharePoint 2010. Replace them with Powershell scripts and you shall get your result - http://pholpar.wordpress.com/2010/02/11/adding-a-managed-metadata-column-to-a-list-via-sharepoint-server-2010-object-model/ | |||||||
feedback
|
|
Sorry for the self promotion, but I have a post that shows you how to create a Managed Metadata column & add it to an existing list. Downloadable project as well: http://www.andrewconnell.com/blog/archive/2011/07/25/sharepoint-2010-managed-metadata-creating-managed-metadata-columns.aspx | |||
|
feedback
|
|
The code below is a mix of some PS code i had laying around and stuff translated from C# on the fly (so there might be some errors in there :-D) Also, this code creates a fullblown site column in the SPWeb and adds that to the list To start, you need a reference to the termstore, i've written 2 functions that use CA and the metadata service app's type to get a standard installation's Termstore:
now you can use these methods to access the termstore and get a reference to a TermSet to which to bind your new field
and using that function, we can create a function that creates a managed metadata site column in an SPWeb
Now all we need is a function to add the field to a list
EDIT: I am a big fan of PowerGUI, a great (free!) tool to write, test and debug(!!) your powershell scripts! | |||
|
feedback
|