1

I'm setting up a Office365 / SharePoint Online portal using Powershell and CSOM and have sorted almost everything out except adding this:

Library Settings -> Enterprise Metadata and Keywords Settings -> Add an Enterprise Keyword column to this list and enable Keyword synchronization from the UI.

The code im using to add the WikiPage Library is:

#Add references to SharePoint client assemblies and authenticate to Office 365 site
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

$Username = "username"
$Site = "sitename"
$ListTitle = "WikiPageLib"
$Password = Read-Host -Prompt "Please enter your password" -AsSecureString
$Context = New-Object Microsoft.SharePoint.Client.ClientContext($Site)
$Creds = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredential($Username,$Password)
$Context.Credentials = $Creds

#Create List
$ListInfo = New-Object Microsoft.SharePoint.Client.ListCreationInformation
$ListInfo.Title = $ListTitle
$ListInfo.TemplateType = "119"
$List = $Context.Web.Lists.Add($ListInfo)
$List.Description = $ListTitle
$List.Update()
$Context.ExecuteQuery()

I have only found C# and on-premise solutions, nothing for SharePoint Online. Any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.