Recent Posts
Could not load file or assembly.... OfficePnP Nuget package conflict issues
If you are using OfficePnP or SharePoint PnP nuget packages in your solution, often you end up with DLL conflicts and may throw error “Could not load file or assembly…” I have faced this many times and was struggling to fix this. This article is about how to solve the dll conflicts while adding OfficePnP nuget to your solution.
What is the problem?
Most of the cases, we may want to utilize the OfficePnP solution customize our SharePoint sites.
read more
Configure SharePoint Hub Sites
The most awaiting feature “Hub Sites” is released now. Hub sites allow the related site content to roll up to the Hub site’s home page, like News. There is no specific template for Hub sites and you can convert your existing modern Team site or Communication site to a Hub site by running PowerShell script. You can have up to 50 Hub sites in your tenant as per MS article.
read more
Replace webpart on a SharePoint Modern page
There can be scenarios where webpart on a page should be replaced with an updated one. For eg:- Recently Microsoft had released an updated Yammber webpart and the webpart already placed on a page will not be disrupted or changed. In this case it is difficult to replace it manaually.
Here is the starting point for this task. Below sample code shows how to replace the Yammer webpart progrmatically. It reads the properties of the existing webpart and replaces it with the updated one and then saves the properties back to the newly added webpart.
read more
Office 365 Management Activity API - C#
Here is the code sample to connect to office 365 management API. Article explains the Azure AD configuration, OAuth authentication and the compliance api usage with HttpClient.
Before we start with, we need to configure the Azure AD app to give necessary permission for o365 Compliace API to access the data
Follow the MSDN article to configure the Azure AD App.
Execute the following 4 steps from the article
We will be using the HTTP message handler that uses OAuth authentication through ADAL
read more
Get Modern Team and Communication sites - SharePoint Online - CSOM
Here is the quick sample code to extract all the site collections from SharePoint Online tenant, including the classic,modern team sites and communication sites.
This solution is based on Microsoft PnP . Follow the steps below
Create a console application and then add the Nuget package ‘SharePointPnPCoreOnline’ Add the references using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
Following lines of code will return all the sites including Modern Team and Communication sites.
read more