Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

How do I import a CSV file to metadata service using PowerShell? The CSV file has 500 rows and seven levels in it (Importing of term store).

share|improve this question

1 Answer 1

This is the PS script I'm using:

    Param([string]$CentralAdminURL, [string]$TermsCSV, [string]$ADGroup)

    # loading the term store
    $site = Get-SPSite -Identity($CentralAdminURL)
    $session = new-object Microsoft.SharePoint.Taxonomy.TaxonomySession($site)
    $termstore = $session.TermStores[0]

    # Create a Taxonomy Group
    # I first create a Term Group
    $termGroup = "MY MM Group"
    $group = $termstore.CreateGroup($termGroup)
    # Import Taxonomy "Know How"
    # Create an instance of ImportManager
    $Importer = $termstore.GetImportManager()
    $varImported = ""
    $varMessages = ""
    $TermSetReader = [System.IO.File]::OpenText($TermsCSV)

    # Syntax: ImportTermSet(TermGroup, TextReader, out isImported, out errorMessage)
    $termset = $Importer.ImportTermSet($group ,$TermSetReader, ([REF] $varImported), ([REF] $varMessages))
    Write-Host $varMessages
    Write-Host $varImported

adapted from the original at http://stevenderveaux.wordpress.com/2010/04/09/import-taxonomy-csv-file-via-powershell/

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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