Search code examples
powershellsharepointmetadataoffice365api

Update SharePoint metadata from C# / Visual Studio


What is an easy way to update metadata in SharePoint via code?

Example: My documents in SharePoint have a dropdown "Project", and I need to set a value for each imported file, based on data from a CSV file.

Should I use:

  • REST API
  • PowerShell
  • DLLs (...using Microsoft.SharePoint)
  • Other?

Solution

  • I think the easiest way is to use PnP.Powershell

    For .NET app, if You don't have experience with SharePoint, I would go with PnP.Core SDK.

    If You are looking for performance, SharePoint REST API should be the fastest, but it requires some knowledge of authentication model and SharePoint API itself.

    Hope that will help.