0

I have written a Powershell script to change the custom sort order of the Metadata Termset. This Termset is pinned Termset and the sorting is not affected in all the Member of Termset. How can i do this ?.

thank you.

0

Try this:

$taxonomySession = Get-SPTaxonomySession -Site "http://sp/sites/dev"

$termStore = $taxonomySession.TermStores["Mananged Metadata"] if($termStore -ne $null)

{
$group = $termStore.Groups["System"]

    if($group -ne $null)

    {                         
        $termSet = $group.TermSets["Keywords"]
        $term1 = $termSet.Terms["#Jerry"]
        $term2 = $termSet.Terms["#Tom"]
        $customSortOrder = $term2.Id.ToString() +":"+$term1.Id.ToString()
        Write-Host($customSortOrder)
        $termSet.CustomSortOrder = $customSortOrder 
        $termStore.CommitAll();
    }

}

  • Yes the above Script only affects the Termsets "Keywords" but the pinned Termsets (MemberOf) will not get the Customorder automcatically. – user1514428 Oct 12 '17 at 9:40

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.