Skip to main content

Posts

Showing posts with the label Managed Meta Data

SharePoint Script to update MMD Column in Library

This post contains the code to update Managed Metadata column value in Library. Add-PSSnapin Microsoft.Sharepoint.Powershell cls #Log Variables $basePath = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent Set-Location $basePath #SP variables $web=$null ; $list=$null; $SiteURL = "https://mysharepointsite/en-us"# Library Site Url $ListName = "Pages";# List Name $FieldName="Document" $termStoreName = "Managed Metadata Service Application" $termGroupName = "Document_Content" $termSetName = "DocumentName" $MMDValueToUpdate = "Technical Doc" #Pre-requisite checks Try {     #Web Check     $web = Get-SPWeb $SiteURL     if($web -eq $null)     {       Write-Host "Cannot find an SPSite object that contains the following Id or Url: $SiteURL"  $_.Exception.Message        Exit     }     #List Check     $list = $web.Lists[$ListName]     if($...