I want to get a term by its synonym. For example, I have unique synonyms and I want to get the term and other synonyms using this unique synonym. All using powershell. is there a way to do that?


In each term, there is a labels property, which stores the primary label and the synonym using the "isDefaultLanguage" flag...



$session = New-Object Microsoft.SharePoint.Taxonomy.TaxonomySession($Site)
$termStore = $session.TermStores["Managed Metadata Service Application Proxy"]
$group = $termStore.Groups[$TermGroupName]
$termSet = $group.TermSets[$TermSetName]
$terms = $termSet.GetTerms(1000)

foreach($term in $terms){
  $labelsyn=$term.Labels|?{$_.IsDefaultForLanguage -eq $false}
  write-host $term.name ',' $labelsyn.value

Assuming you only have one synonym per term, this should at least get you close.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.