SharePoint PNP Get Sub Sites in Site Collection


The script below will provide you list of sites in Site collection using SharePoint PNP PowerShell

$Creds = Get-Credential
$SiteUrl = "https://tenant.sharepoint.com/sites/sitecollection"
Connect-PnPOnline -Url $SiteUrl -Credentials $Creds
$Site = Get-PnPSite
$Web = Get-PnPWeb

function GetSubWebs($Web, $Context)
{
    $Global:SiteCount++
    $Context.Load($sweb.Webs)
    $Context.ExecuteQuery()
    foreach($aWeb in $sweb.Webs)
    {
        $aWeb.Url
        if($aWeb.Webs.Count > 0)
        {
            GetSubWebs $aWeb $Context
        }
    }
}

$Context= Get-PnPContext
$webs= $Web.Webs
foreach($sweb in $webs)
{
    $Context.Load($sweb)
    $Context.ExecuteQuery()
    $sweb.Url
    GetSubWebs $sweb $Context
}

SharePoint 2010 Workflow Retirement update


SharePoint2010 #Workflow Retirement update with #ModernizationScanner Report for Workflows and full #ApprovalWorkflow from 2010 – 2013 to Power Automate Flow

Please check the video below that provides the initial guidelines on what to do for SharePoint 2010 Workflow that will be disabled later this year. we also tried to provide some insights on how to convert the 2010 workflow to SharePoint 2013 workflow and Power Automate.

I am back!!! I think.


I am back…. I think so. It has been long time since I blogged anything useful other than the tons of PowerShell I have been posting. Finally I thought about changing the blogging model. Instead of blogging text I will be logging videos. The topics will be mostly random based on what I am mostly working during the day.

My work does not have a pattern. I start my day with Power Automate Flow followed by PowerShell script, later a Power App and could be updating classic AngularJS solutions built on top of SharePoint and by end of day I could be writing or deploying an SPFX Web Part for my customers. This put me in unique position.

What’s going on for me

First of all I updated my work environment. Moved my table to a position that is facing the wall finally :). Bought a Ultrawide 49 inch 5K display and setup my Lenovo P53 machine with I9 processor. The feeling is pretty good. Check below.

Dell Ultrawide 5K Display

Microsoft MVP for Another Year

The next news is that I was renewed as Microsoft MVP – Office Apps and Services for another year. It is a great honor as I am not an MVP for 11 Years. I must be the first MVP from Pakistan to to pass the 10 year mark to get this award.

Pakistani MVP Meetup

Just last week, after months of planning πŸ™‚ I was able to get hold of few Pakistani MVPs to do a quick meeting. 3 out of 5 were able to join from 3 different regions of the world. It was fun to talk to them. I am sharing the video. We did not talk allot about technology as it as mostly a friendly chitchat (and Yes, I was not looking at the Camera. My web cam just few minutes before the call so I had to use my laptop camera). You can check it out below.

That’s all for now. looking forward to the next video.

Jerry Yasir

Microsoft Power Automate – Avoid Loop on SharePoint Item Update


There might be situations where we will have to update a SharePoint list inside Microsoft Power Automate Flow. When we run the flow manually on list items then the workflow runs without any issue. But if we perform the update inside When Item is Created or Update trigger, the flow goes to a not ending loop. In the video below I have tried to cover this scenario.

using call the SharePoint Rest service

In the 2nd part of the video, I have shown the method of using the call the https service for SharePoint using the SharePoint REST service. This method is very suitable when you have large number of columns but want to update only few columns. Check it below