Skip to content

Instantly share code, notes, and snippets.

View SanderLesage's full-sized avatar

Sander Lesage SanderLesage

View GitHub Profile
@SanderLesage
SanderLesage / CreateDocumentSet.cs
Last active February 8, 2017 15:42
Create document set in SharePoint Online
/// <summary>
/// Create documentset from folder
/// </summary>
/// <param name="ctx">SharePoint clientcontext</param>
/// <param name="libraryUrl">web relative document library url</param>
/// <param name="documentSetName">name for the new document set</param>
/// <param name="documentSetContentTypeId">content type of the new document set.
/// We assume that this content type is already binded to the document library.</param>
public ListItem CreateDocumentSet(ClientContext ctx, string libraryUrl, string documentSetName, string documentSetContentTypeId)
{
@SanderLesage
SanderLesage / UpdateWebTitle.cs
Created March 2, 2016 14:58
Update SharePoint web title for all languages
using (var ctx = new ClientContext(webUrl))
{
//get web and load required properties
var web = ctx.Web;
ctx.Load(web, w => w.SupportedUILanguageIds, w => w.TitleResource);
ctx.ExecuteQuery();
//change site title for all supportedUILanguages.
var resource = web.TitleResource;
foreach (var culture in web.SupportedUILanguageIds)