none
Find blogs and classic pages RRS feed

  • Question

  • Hi,

    Does anyone know of a quick way to find where all your classic pages are and blog sites? The reason for this is we want to modernise them however we need to identify where they are first and their owners.

    Thanks,

    Clare

    Monday, December 9, 2019 4:53 AM

Answers

  • Hi,Clare,

    For searching all the classic pages, here I made a script as the starting point. It will return all the classic pages. One thing to mention, the modern pages not published with a banner image will also be counted as classic page by this script, you may need to do a bit more work about this. 

    $SiteUrl="https://siteurl"
    $User = "user account" 
    $Creds = Get-Credential
    Connect-PnPOnline -Url $SiteUrl -Credentials $Creds 
    	    $items = $null 
                $items = Get-PnPListItem -List “SitePages” -Fields ID,Title,BannerImageUrl,FileRef -ErrorAction SilentlyContinue 
                if($items) 
                { 
                    foreach($Page in $items) 
                    { 
    		if($Page[“FileLeafRef”] -like '*.aspx')	{
                        Write-Host “.” -NoNewline 
                        if($Page[“BannerImageUrl”].Url -eq $null) 
                        { 
                            Write-Host “.” -NoNewline 
                            $FileName = $Page[“FileLeafRef”] 
                            $PageUrl = “$($SiteUrl)/SitePages/$FileName” 
                            
    			write-host $PageUrl
                        } 
                    } 
    		}
                } 

    For blog sites, here is a great script you can refer to:https://gallery.technet.microsoft.com/office/SharePoint-Online-Get-list-0a53567e

    Reference:https://gallery.technet.microsoft.com/office/Get-List-of-Modern-Pages-9ae35436#content

    Best Regards

    Jerry


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    • Marked as answer by Walshey Tuesday, December 10, 2019 3:58 AM
    Monday, December 9, 2019 8:24 AM