Create a SharePoint Communication site in CSOM

Hello,

In this blog post, I’m assuming you know what CSOM is and how to use the PNP framework.

You will find below the code to create a communication site in CSOM using PNP framework.

Communication sites come with 3 different templates :

  • Topic
  • Showcase
  • Blank

Those templates have a specific GUID, you can reuse them in order to provision your site with the right template directly :

  • Topic: null
  • Showcase: 6142d2a0-63a5-4ba0-aede-d9fefca2c767
  • Blank: f6cc5403-0d63-442e-96c0-285923709ffc

The code below will show you how to create a Showcase site with the title “MyComSite” :

            using (ClientContext ctx = new ClientContext("https://MYTENANT-admin.sharepoint.com"))
            {
                SecureString ss = new SecureString();
                foreach (char c in "MYPWD") { ss.AppendChar(c); }
                ctx.Credentials = new SharePointOnlineCredentials("account@MYTENANT.onmicrosoft.com", ss);

                var creationInformation = new OfficeDevPnP.Core.Sites.CommunicationSiteCollectionCreationInformation();
                creationInformation.Title = "MyComSite";
                creationInformation.Url = "https://MYTENANT.sharepoint.com/teams/MyComSite";
                creationInformation.Description = "MyComSite Description";
                creationInformation.AllowFileSharingForGuestUsers = false;
                creationInformation.Lcid = 1033;
                creationInformation.SiteDesignId = Guid.Parse("6142d2a0-63a5-4ba0-aede-d9fefca2c767");
                var results = ctx.CreateSiteAsync(creationInformation);
                //waiting until the site is created
                var returnedContext = results.GetAwaiter().GetResult();
                //this is done so display the context url
                Console.WriteLine(returnedContext.Url);
            }

 

Advertisements
Posted in Office 365, SharePoint | Tagged , , | Leave a comment

SPO: Enforce the new UI even when clicking on Return to Classic

Hello,

In the post, I will show you how you can enforce the new UI to your SharePoint Online site.

I will assume that you know how to setup a user custom action running a JavaScript script on the site.

Continue reading

Posted in Office 365, SharePoint | Tagged , , , | Leave a comment

Azure Function App: Reference a Custom DLL

Hello,

In this post, I’m explaining you how to reference a custom “private” DLL in your Azure Function App. In a previous post, I taught you how to reference DLL using NuGet (https://loicsterckx.wordpress.com/2017/02/17/how-to-retrieve-nugget-packages-in-azure-functions ).

Here it’s about a custom DLL that you want to keep private. A company framework for instance.

Continue reading

Posted in Azure | Leave a comment

Easily Deploy Your Azure WebJob With a TFS Release Definition


Hello,

In this blog post, I will explain you how to deploy an Azure WebJob via a release definition in TFS Online.

I will assume that you know what is a WebJob and how to manage it, but also how to use and configure TFS Online. I’m considering that you have the WebJob already deployed and configured to your subscription.

Continue reading

Posted in Azure, C# Solutions | Tagged , , , , , , , | Leave a comment

Azure Functions: backup your OneDrive at rocket speed!

Hello,

OneDrive is a great tool and I’m for sure not somebody that needs to be convinced about that.

Anyway, as Office 365 admin for instance, when your end-user leaves the company, for some company policies you might need to keep the data for a long term, like years…

When on premise it was easy take the storage and done, but what about if you’re in Office 365?

Azure Functions to the rescue !

In this post I will teach you how to create very performant Azure functions that will backup your OneDrive for Business content to an Azure Blob Storage.

Continue reading

Posted in Azure, C# Solutions, OneDrive | Tagged , , , | Leave a comment

How to retrieve NuGet packages in Azure Functions

Hello,

In this blog post I will show you how to retrieve NuGet packages in your Azure Function

Continue reading

Posted in Azure, C# Solutions | Tagged , , , | 1 Comment

OneDrive for Business: The Admin Portal and 5 Tb as Default Storage!

Hello,

Microsoft recently released the OneDrive admin portal.

A lot of product in Office 365 had dedicated admin portal, but for some reason OneDrive wasn’t.

You had then to work a lot with PowerShell or pass through the SharePoint Online to do stuff.

Now, with the admin portal accessible with this URL : https://admin.onedrive.com , it is easier to manage OneDrive inside your organization.

Continue reading

Posted in Office 365, OneDrive | Tagged , , , | Leave a comment