Adding Term Store Groups Using PowerShell in SharePoint

You can use Windows PowerShell when adding Term Store Groups. You can start by using the Get-SP Taxonomy Session cmdlet to get a Taxonomy Session object. A Taxonomy Session object will contains the set of metadata term stores for a taxonomy session:

PS > $session = Get-SPTaxonomySession -Site http://SP01.powershell.nu

Next, you will get a specific Term Store:

PS > $termStore = $session.TermStores[Metadata Service App Proxy]

Now, we can use the CreateGroup() method to create a new Term Store Group:

PS > $group = $termstore.CreateGroup(My New Group)

You can set additional Properties on the Term Store Group, such as Description:

PS > $group.Description = "My Term Group"

When you’re done, you can use the CommitAll() method to push the changes to SharePoint 2010:

PS > $termStore.CommitAll()

Twitter This Tip! ReTweet this Tip!


Posted Apr 13 2012, 06:00 AM by sos
Idera SharePoint Reviews SMBology, Inc. Rackspace Hosting Sponsored by Idera and SharePoint Reviews and SMBology and EPCGroup.net
Copyright 2011 SecretsOfSharePoint.com. All rights reserved.