Steps
- Open your SharePoint Management Shell.
- Copy the code given below and paste it there.
- Run the code given below to delete the SharePoint search component.
Code
- $taxonomySession=Get-SPTaxonomySession -Site "https://gowtham.sharepoint.com/tutorials"
- $termStore=$taxonomySession.TermStores["MMS"]
- $group=$termStore.CreateGroup("MMSGroup")
- $termStore.CommitAll()
Another Reusable code- function DeleteTermGroup
- {
- param([string]$site,[string]$termstoreName,[string]$groupName)
-
-
- $session = new-object Microsoft.SharePoint.Taxonomy.TaxonomySession($site)
- $termstore = $session.TermStores[$termstoreName]
- $group=$termStore.CreateGroup($groupName)
- $termstore.CommitAll()
-
- Write-Output "Create $groupName"
Delete Term Group - function DeleteTermGroup
- {param([string]$centralAdmin,[string]$termstoreName,[string]$groupName)
-
- $site = Get-SPSite $centralAdmin
- $session = new-object Microsoft.SharePoint.Taxonomy.TaxonomySession($site)
- $termstore = $session.TermStores[$termstoreName]
- $group=$termStore.Groups[$groupName]
- $group.TermSets|foreach{
- $_.Delete()
- $termstore.CommitAll()
- }
- $group.Delete()
- $termstore.CommitAll()
-
- Write-Output "Deleted $groupName"
-
- }
Thanks for reading my blog.