读取托管元数据列所需的CSOM powershell脚本 [英] CSOM powershell script needed to read managed metadata column

查看:72
本文介绍了读取托管元数据列所需的CSOM powershell脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何阅读元数据列术语及其属性。我在下面写了脚本,但元数据列是空的


$ url =" https:// abc "
$
Add-Type -Path" C:\Program Files \Common Files\microsoft shared\Web Server扩展名\ 15 \ ISAPI \ MyCrosoft.SharePoint.Client.dll"
$
Add-Type -Path" C:\Program Files \Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
$
Add-Type -Path" C:\Program Files \Common Files \ Mycoftoft Shared \ Web服务器扩展\\\\\\\\\\\\\\\\\\\\


Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue




    $ clientcontext = New-Object Microsoft.SharePoint.Client.ClientContext($ url)

$ list = $ clientContext.Web.Lists.GetByTitle(" Organization") 

$ clientContext.Load($ list)

$ clientContext.ExecuteQuery()




  $ Items = $ list .GetItems([Microsoft.SharePoint.Client.CamlQuery] :: CreateAllItemsQuery()) 


    $ clientContext.load($ Items)

$ clientContext.ExecuteQuery()


$ field = $ list.Fields.GetByInternalNameOrTitle(" Org")

$ clientContext.load($ field)
$
$ clientContext.ExecuteQuery()


foreach($ Item in $ Items) 

   { 

       写主机"ID - " $ Item [" ID"]" Title - " $项目["标题"]鸟


  #[Microsoft.SharePoint.Taxonomy.TaxonomyFieldValue] $ MMSFieldValue =

   [Microsoft.SharePoint.Client.Taxonomy。 TaxonomyFieldValue] $ MMSFieldValue = $ item [" Org"]


   $ MMSFieldValue


  }


请帮忙!!!







解决方案

请关注这些文章


https://social.technet.microsoft.com/wiki/contents/articles/23494.sharepoint-use-powershell-to- find-fields-using-a-managed-metadata-termset.aspx


http://www.sharepointdiary.com/2015/12/read-update-managed-metadata-column- values-using-powershell.html


谢谢


Kislay


如果有帮助,请标记为答案


How can I read Metadata column terms and its properties.I wrote below script but metadata column is coming as empty

$url = "https://abc"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Taxonomy.dll"
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue


    $clientcontext= New-Object Microsoft.SharePoint.Client.ClientContext($url)
$list= $clientContext.Web.Lists.GetByTitle("Organization") 
$clientContext.Load($list)
$clientContext.ExecuteQuery()


 $Items = $list.GetItems([Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery()) 
    $clientContext.load($Items)
$clientContext.ExecuteQuery()

$field=$list.Fields.GetByInternalNameOrTitle("Org")
$clientContext.load($field)
$clientContext.ExecuteQuery()

foreach($Item in $Items) 
   { 
        Write-Host "ID - " $Item["ID"] "Title - " $Item["Title"] 
  #[Microsoft.SharePoint.Taxonomy.TaxonomyFieldValue]$MMSFieldValue =
  [Microsoft.SharePoint.Client.Taxonomy.TaxonomyFieldValue]$MMSFieldValue=$item["Org"]
  $MMSFieldValue

  }

Please help!!!

解决方案

Please follow these articles

https://social.technet.microsoft.com/wiki/contents/articles/23494.sharepoint-use-powershell-to-find-fields-using-a-managed-metadata-termset.aspx

http://www.sharepointdiary.com/2015/12/read-update-managed-metadata-column-values-using-powershell.html

Thanks

Kislay

In case it helps you please Mark as answer


这篇关于读取托管元数据列所需的CSOM powershell脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆