Termstore script

07/01/2012 11:49


1.Term store import with translation - adding to existing termset possibly
2.Term store export with translations
3.Term store access test - verifying all services, permissions for current account, people picker instalation...
ADD TERMSTORE ADMINISTRATOR

$userName="avd-corp\l.sevcik"
$CAPort="16546"
$siteUrl=https://buyingportalint.dcs.avd.com


$AdminName = $userName
$taxonomySession = Get-SPTaxonomySession -Site $siteUrl
$termStore = $taxonomySession.TermStores[0]

   
if($termStore -ne $null)

    {     
    # Removing all the existing TermStore Administrators
    foreach($admin in $termStore.TermStoreAdministrators)

        {
            $termStore.DeleteTermStoreAdministrator($admin.PrincipalName);

        }       

     #Adding new term Store Administrator
    $termStore.AddTermStoreAdministrator($AdminName);          
    $group = $termStore.Groups["avd Group"]

    if($group -ne $null)
            {    

            #Updating Owner of all the term set.                   
            foreach($termSet in $group.TermSets)

                  {
                    $termSet.Owner = $AdminName;

                  }

            }

    }
          
$termStore.CommitAll();