Browse Category

Search

Find and Report on Existing Delve Blogs

With the announcement that Delve blogs will be retiring you may want to see what blogs exist in your tenant. Delve blogs create their own site collection but do not show up in the admin center or when you use the SharePoint PowerShell module and the Get-SPOSite cmdlet. Thankfully PnP Powershell does return this. I put together a PowerShell script to find blogs and put a report together including the number of posts.

First, install PnP PowerShell if you haven’t already. I recommend installing via the PowerShell gallery with the command:

  • Install-Module SharePointPnPPowerShellOnline

Here is a script to find and export the blog information using PnP Powershell. Ensure you fill in your own variables for your tenant and the file path.

try {

    #variables -> enter your own domain and output path
    $creds = Get-Credential
    $tenantadmin = "https://domain-admin.sharepoint.com"
    $outputfilepath = "c:\temp\delveblogexport.csv"

    #connect to tenant to get blog sites
    Connect-PnPOnline $tenantadmin -Credentials $creds
    $sites = Get-PnPTenantSite -Template POINTPUBLISHINGPERSONAL#0

    $resultsarray = @()

    #loop through sites to get details for blog
    foreach($s in $sites){
        Connect-PnPOnline $s.Url -Credentials $creds
        $list = Get-PnPList -Identity "Pages"
        $pagecount = $list.ItemCount
        $listlastmodified = $list.LastItemUserModifiedDate
        $contributor = Get-PnPGroupMembers -Identity "Contributors" | select Email

        #add to export object
        $obj = New-Object PSObject
        Add-Member -InputObject $obj -MemberType NoteProperty -Name DelveBlogUrl -Value $s.Url
        Add-Member -InputObject $obj -MemberType NoteProperty -Name BlogPageCount -Value $pagecount
        Add-Member -InputObject $obj -MemberType NoteProperty -Name LastModified -Value $listlastmodified
        Add-Member -InputObject $obj -MemberType NoteProperty -Name Email -Value $contributor.Email

        $resultsarray += $obj
        $obj = $null

        Disconnect-PnPOnline

    }
    #export results
    $resultsarray | Export-Csv -Path $outputfilepath -NoTypeInformation
    Write-Host "Complete" -ForegroundColor Green
}
catch
{
    Write-Host $_.Exception.Message -ForegroundColor Red
}

The results will include the URL of the site, the page count, last modified, and the email of the blog site owner.

If you want other details per page you can go directly to the pages library to view by applying “pPg/Forms/AllItems.aspx” to the blog site url. As an example:

When you go to the pages library you can download the posts. They exist in a JSON blob. This may be a good way to extract blog posts before they are removed via Microsoft.

To view the posts you will still go through “portals/hub/personal/drew” path vs “portals/personal/drew”.


Another path to get some of this information is through the User Profiles that exist. Each user profile includes a link to their Delve blog. So if you get all existing user profiles you can find where that value is filled in. The best way to get this at scale is through SharePoint search. I put together a script to do this as well. I included batching logic on the results which will be needed in large tenants as the max search results is only 500.

try
{
    #variables -> enter your own domain and output path
    $creds = Get-Credential
    $tenantadmin = "https://domain-admin.sharepoint.com"
    $outputfilepath = "c:\temp\delvebloguserprofileexport.csv"
    $returnproperties = @("PreferredName","AccountName","WorkEmail")
    $sourceid = "B09A7990-05EA-4AF9-81EF-EDFAB16C4E31"  #this is consistent across tenants
    $maxresults = 100
    $startrow = 0

    #connect to tenant to search
    Connect-PnPOnline $tenantadmin -Credentials $creds

    $resultsarray = @()
    Do{
   
        #perform search query
        $results = Submit-PnPSearchQuery -Query "*" -SourceId $sourceid -SelectProperties $returnproperties -StartRow $startrow -MaxResults $maxresults -SortList @{LastModifiedTime="Descending"} 
        $rowcount = $results.RowCount

        #loop through results in row
        foreach($res in $results.ResultRows){

            #get user profile properties
            $props = Get-PnPUserProfileProperty -Account $res.AccountName

            #check if blog site exists
            if($props.UserProfileProperties.'SPS-PointPublishingUrl' -ne ""){

                #add to export object
                $obj = New-Object PSObject
                Add-Member -InputObject $obj -MemberType NoteProperty -Name DelveBlogUrl -Value $props.UserProfileProperties.'SPS-PointPublishingUrl'
                Add-Member -InputObject $obj -MemberType NoteProperty -Name WorkEmail -Value $props.UserProfileProperties.WorkEmail
                $resultsarray += $obj
                $obj = $null
            }
        }
        $startrow = $startrow + $rowcount + 1
    }
    while ($rowcount -ne 0)
    
    #export results
    $resultsarray | Export-Csv -Path $outputfilepath -NoTypeInformation
    Write-Host "Finished" -ForegroundColor Green
}
catch
{
    Write-Host $_.Exception.Message -ForegroundColor Red
}

This is not the most efficient way to get this information but it could be helpful to double check the SharePoint sites approach. This is also a handy way to loop through user profiles via search.

How to Promote Office 365 Video Search Results in SharePoint

The Office 365 Video portal is a great solution for managing videos. It is much better than trying to host videos in a standard site collection in SharePoint Online. I don’t want to go into the Office 365 Video portal in this post but here are some great starting points.

After using the Office 365 Video portal both internally and with clients there was one area that I wanted to try to improve on, searching and finding. The majority of clients I work with have a standard intranet with many now being hosted in SharePoint Online. When I help with intranet builds I try to incorporate the search center as a key piece of functionality. In Office 365, this is a prebuilt site collection under the URL – https://domain.sharepoint.com/search.

With the search center, I try to include core metadata that can be used as refinement when possible. As the search center can be a central area for functionality I wanted to try to improve the usability of the current Videos vertical refiner with better incorporation of videos hosted in the Office 365 Video portal. Office 365 Videos are already returned in search results via this refiner but this will most likely also pull junk videos people have uploaded across SharePoint.  So I was looking for a way to clean this up.

  • A simple solution to hide junk videos is to promote all videos that are hosted in the Office 365 Video portal above any other items being returned through the Videos search results through a query rule.

Here was our search center before…

2016-01-15-23_11_28-Search_-Internet-Explorer_thumb (1)

Here is our search center after…

image_thumb

As you can see the videos that we want people to see are now front and center.  I also added the Content Type refiner so people could pick other Content Types besides Cloud Video.

Steps to build the query rule

** As a reference I am building this query rule just on the Search site collection.  This could be done at the tenant level as well.  **

  1. Navigate to your search center as someone who has site collection administration
    • https://domain.sharepoint.com/search
  2. Use the gear to go to Site Settings.   Under Site Collection Administration click Search Query Rules
    • image_thumb1
  3. Click the Select a Result Source… drop down and select Local Video Results (System)
    • image_thumb2
  4. Click New Query Rule
    • image_thumb3
  5. Give it a name (i.e. Video Portal Promotion)
  6. Under Query Conditions, click Remove Condition. We are selecting this because we want this to fire on all events.
    • image_thumb4
  7. Under Actions, click Change ranked results by changing the query
    • image_thumb5
  8. Under the Sorting tab, change the Sort by to be by Rank
    • image_thumb6
  9. On the same sorting tab, click Add dynamic ordering rule
    • image_thumb7
  10. Now we get to change the ranking.  On the first drop down select Manual condition.  In the manual condition, we only want to return videos from the O365 video portal.  To do this we will filter by the ContentTypeID.  There is a new content type called “Cloud Video” that is published with videos in the O365 video portal.  The last section of the ContentTypeID is not consistent across channels (site collections) but the beginning string is.  Here is the condition:
    • ContentTypeId:0x010100F3754F12A9B6490D9622A01FE9D8F012*
  11. Ensure the last drop down states Promote to top and then click OK and Save.
    • image_thumb8
  12. Sit back and look at your great new query rule
    • image_thumb9
  13. Now if you run a search your good videos will always be before your bad videos
    • image_thumb10

The last step you could do is add the Content Type option as a refiner.  This is done through editing the page and editing the refiner web part.

With videos being available in search and the power of Display Templates in SharePoint, this could be just the start of integrating videos back into your SharePoint sites and user experiences.