Skip to main content

Posts

Showing posts from October, 2022

SharePoint Online - Export Term Store data

We had a requirement to export Terms from a particular Term Store Group in our SPO tenant but I couldn't find a script that goes in to Level 2 and Level 3 Terms or if there is one out there I couldn't find it. I checked many forums and blogs and thanks to all those contributors who inspired me to come up with this script. This isn't perfect by any means and I would like to improve and clean this up a bit but I'm sharing this here so its documented where I can fix this later and also probably help someone. The script will export the data in hierarchical form in a .csv file.   # Tenant url $url="<enter your SharePoint admin url>" # Term Group names as an array $groups = @("")  # location of CSV file $FilePath="Terms.csv"  # Variable to collect all data and export to CSV $results = New-Object System.Collections.ArrayList # Function to iterate through Term store function Get-TermsAsCSV {           try       {           if($groups.Length -