Dec 29, 2019

Transform Classic Page to Modern Page using PNP Powershell - SharePoint Online

Hello guys,

As the current trend is migrating on-premise versions of SharePoint to online, we definitely come across with a requirement to convert the classic sites to modern sites .

In this post i am going to show how we can transform the classic SharePoint page to modern page. There are couple of approaches to do this transformation,  like using PowerShell, .Net and SharePoint Transformation UI using ModernizationFramework .

In this post i am explaining the PowerShell method. The PnP Powershell provides a way to transform the classic SharePoint page to modern SharePoint page.

Before looking in to this code, I just wanted you to have a look of how my SharePoint Classic Page looks before transformation. Here is a sample Classic Home Page with four webparts on it.



This Classic page contains default tiles webpart with two list view and one image webpart .The layout being used here is Three Columns with Header.

Now its time to look in to the transformation PnP commands:

The prerequisite to this script is PnP Powershell module. If you don't have it already,  install it using below command .  This will install the latest PnP powershell version

Install-Module SharePointPnPPowerShellOnline

This transformation script requires a PnP Powershell 3.4 or higher . If you already have the older version and want to upgrade to latest , run the same command with '-Force' parameter .

Install-Module SharePointPnPPowerShellOnline -Force

Once we are ready with PnP, run the below script to transform the page :

Connect to the site where your page exist and convert to Modern page by giving its name ( here DevHome.aspx is the name of my classic page )

Connect-PnPOnline -Url https://mad429.sharepoint.com/ 

ConvertTo-PnPClientSidePage -Identity DevHome.aspx


Once the conversion is done, it creates a modern page with name Migrated_[Classicpagename].aspx. In this case the converted page name is Migrated_DevHome.aspx.



Below is the Converted Modern Page ( Migrated_DevHome.aspx) with the four webparts as in classic page.






If you want to keep the original name to modern page, there is a parameter called "TakeSourcePageName". This creates the modern page with the Classic Page Name and keeps the classic page name as Previous_[ClassicPage].aspx

ConvertTo-PnPClientSidePage -Identity DevHome.aspx -TakeSourcePageName

There are couple of parameters avail for this ConvertTo-PnPClientSidePage command. Here is the link from msdn where you can find complete details of this powershell approach.

Also, there is an option of giving end users to decide whether they can keep the transformed version of page or discard it. This can be done using AddPageAcceptBanner parameter to the above command and installation of PageBanner Webpart. This is still evolving topic, please refer here for more details.

If you notice the above transformation , all four webparts are transformed perfectly to modern look and feel . But this is not true for all the webparts . There are few webparts/functionalities may not supported by this transformation. So get ready with your re-design approach before jumping in to transformation.

In this post i just showed the transformation for one page . But you can write for all site pages with different parameters as per your need. Refer this Microsoft Docs Link  for more details about this  evolving topic.

Hope you like this post !



Jul 13, 2019

Everything is fine, but we had a small problem getting your license.. SharePoint 2013 AppStore Error

Recently i configured app store on my SharePoint 2013 environment and when i try to add the app from appstore , i got  below message :

Error :
" Everything is fine, but we had a small problem getting your license. Please go back to the SharePoint Store to get this app again and you wont be charged for it. "


Fix :
Usually you get this error when you try to add app using system account. So use non system account.


May 16, 2019

Root Element Missing when connecting to SharePoint online via CSOM/Powershell on windows 10 machine

Hello friends,

Recently i got a situation where suddenly my csom code is stopped working . This CSOM code is to connect a SharePoint online site to fetch data from some list. The same code was running fine earlier.

Issue Description:

When connecting to SharePoint Online site using CSOM or Powershell(using Connect-SPOService command) from Windows 10 machine getting an error "Root Element Missing"

CSOM error : 

At context.ExecuteQuery it thrown "Root Element Missing" with below stack trace




Powershell Error :



Tried in different ways to fix this, like from changing the schema of my app config file, clearing VS cache , running on new version vs 2019 professional , by referring the new CSOM dlls ,clearing Nuget Package cache and finally formatting windows 10. But none of them helped me out.

also

1> The same code worked in other machine
2> The same code working for other online sites from same machine

I was so confused that, whether it is an issue from my machine or the SharePoint site. I noticed that, the stack trace is clearly showing there is an xml notation issue in SharePoint Client libraries.

Finally after troubleshooting for days i found that the issue is with my ISP( Internet Service Provider ) /internet settings.

Resolution :
Changing the DNS settings will resolve this issue. Here are the steps.

Go to Control Panel --> Network and Internet --> Change Adapter Settings --> Select the Network through which you are connecting to Internet



Right click on it and Select Properties. Then select Internet Protocol Version 4 (TCP/IPV4) and select properties



Then select the "Use the following DNS Server Addresses" instead obtain DNS server addresses automatically and give the DNS whatever you want. Here i gave the free DNS address which is offered by google.

Google public DNS addresses : 8.8.8.8 and 8.8.8.4 

Then say OK to apply these changes.

I ran the code again , both csom and powershell worked well without any issues.

References :
https://www.koskila.net/fixing-security-reasons-dtd-prohibited-xml-document-issue/
http://asp.net-hacker.rocks/2016/01/15/XML-parsing-problem-because-of-your-ISP.html
https://www.windowscentral.com/how-change-your-pcs-dns-settings-windows-10

Hope this helps somebody.

Thanks
Purna

Sep 23, 2018

Customizing SharePoint Online (Office 365) Login Page


Friends,
Here I am going to explain you, how we can customize the look and feel of login page of a SharePoint online site.
Prerequisite to perform this action is , you should have global admin rights on the tenant.

As you know the default SharePoint online page looks like below (I am using personal free trail account, so the login page may look slight different from the licensed/organizational one).
























Here are the steps to customize the login page

Login to your office365 admin page (https://admin.microsoft.com/AdminPortal)  with your admin credentials.

Expand Navigation Menu (>) à Select Admin Centersà Select Azure Active Directory




Then it will redirect you to Azure portal (url looks like https://aad.portal.azure.com ), then select Azure Active Directory from left pane


Select Company Branding --> Select Configure --> You can see a page like below with all options.




























Fill in the details and upload images as per your company branding requirements. Then you can see the login page like below : ( as i mentioned earlier, as this is a trail version you may see slight difference in the design but the approach is same)




Thanks,
Purna

Mar 16, 2017

Reasons why Nintex Workflow doesn't start automatically

Guys,

Nintex workflow doesn’t start automatically because of  :

  1.  Either you are running your workflow with “System Account” or
  2.  In workflow settings  "when items are created/modified set to No" like below figure 
·                                                                   
·        To change this setting to Yes --> Go to your workflow --> Ribbon-->Workflow Settings --> Select Yes in the dropdown.


Sep 24, 2016

ListItem.SystemUpdate is available with new csom version 16.1.5626.1200

Guys,

Long waiting SystemUpdate() method is available with the release of the new csom version(16.1.5626.1200).

Add this csom package using Nuget by searching "Microsoft.SharePointOnline.CSOM" like below



Once you refer these latest csom assemblies, You can see SystemUpdate method for the ListItem like this




Refer this link for all other properties and methods released with this new csom version .
https://dev.office.com/Contents/Item/Display/11116


- PURNA

Sep 22, 2016

Cannot sign in to SharePoint Online using SharePoint Designer 2013 - 403 forbidden403 forbidden403 forbidden403 forbidden403 forbidden

Hi Guys,

Recently i have installed Sharepoint Desinger 2013 and tried to connect to SharePoint Online Site. But it dint allow me to login  and thrown this below error :

"403 forbidden403 forbidden403 forbidden403 forbidden403 forbidden "


I am the tenant admin and have all the rights to open site in designer. So there is no issue with the permissions. The only resolution i found is, updating the designer with ServicePack1.

Here are the links for the service Packs.



Close your designer, install the service pack and re-open it. It works like a charm.!

Hope this helps some one.

- PURNA