SharePoint Online: Import Term Group, Term Set, Term from XML using PnP PowerShell

Requirement: Import Term group, term set and terms data from a XML file to SharePoint Online using PnP PowerShell.

XML File with Term Store Data:
Here is my XML with Term store data
<pnp:TermGroups xmlns:pnp="http://schemas.dev.office.com/PnP/2018/07/ProvisioningSchema">
 <!-- Term Group -->
 <pnp:TermGroup Name="Deals Pipeline" Description="">
  <pnp:TermSets>
   <!-- Term Set 1 -->
   <pnp:TermSet Name="Region" Description="">
    <pnp:Terms>
     <pnp:Term Name="Africa" />
     <pnp:Term Name="Asia" />
     <pnp:Term Name="Australasia" />
     <pnp:Term Name="Europe" />
     <pnp:Term Name="MENA" />
     <pnp:Term Name="America" />
    </pnp:Terms>
   </pnp:TermSet>
   <!-- Term Set 2 -->
   <pnp:TermSet Name="DealStage" Description="">
    <pnp:Terms>
     <pnp:Term Name="Deal Identification" />
     <pnp:Term Name="Screening IC" />
     <pnp:Term Name="Post Screening IC" />
     <pnp:Term Name="Final IC" />
     <pnp:Term Name="Pre-Closing IC" />
     <pnp:Term Name="Signed" />
     <pnp:Term Name="ParCo" />
    </pnp:Terms>
   </pnp:TermSet>
  </pnp:TermSets>
 </pnp:TermGroup>
</pnp:TermGroups>

PnP PowerShell to Import Term store data from XML:
#Config Variables
$AdminCenterURL = "https://crescenttech-admin.sharepoint.com"
$XMLPath = "C:\Users\salaudeen\Desktop\Taxonomy.xml"

#Connect to PnP Online
Connect-PnPOnline -Url $AdminCenterURL -Credentials (Get-Credential)

#Import Term store Group, Term Set and Terms from XML
Import-PnPTermGroupFromXml -Path $XMLPath
and the result:
sharepoint online import term group, term set, terms using powershell
SharePoint Online: Import Term Group, Term Set, Term from XML using PnP PowerShell SharePoint Online: Import Term Group, Term Set, Term from XML using PnP PowerShell Reviewed by Salaudeen Rajack on August 15, 2018 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.