SharePoint 2013 Hosting Tips – How to Check all Sharepoint Page’s Webpart with PowerShell?

Hi, In this post you will learn Powershell Script to Check all Sharepoint Page’s Webpart. SharePoint 2013 adds many new features, including improvements to Lists, Sites, and Pages, as well as a variety of changes pertaining to user interface and locations. In some cases, these changes can cause difficulties in using your sites.  In this article, we will take a look at how to create a Web Part Page in SharePoint 2013. As you know, the Web Part Page is used for adding many Web Parts to a site following the structure on a page. This walkthrough shows you how to create a Web Part Page in SharePoint 2013.hfl-new-banner

Now, write the code below to check all SharePoint Page’s Webpart:

#Add SharePoint cmdlets reference  
Add - PSSnapin microsoft.sharepoint.powershell - ErrorAction SilentlyContinue  

function enumerateWebParts($Url)  
{  
$site = new - object Microsoft.SharePoint.SPSite $Url  

foreach($web in $site.AllWebs)  
{  
if ([Microsoft.SharePoint.Publishing.PublishingWeb]::IsPublishingWeb($web))   
{  
    $pWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($web)  
    $pages = $pWeb.PagesList  

    Write - Host "Processing Web:"  
    $pWeb.Url "http://bmfthnitd125:2222/" - ForegroundColor Magenta  

    foreach($item in $pages.Items)  
    {  
        $fileUrl = $webUrl + "/" + $item.File.Url  
        Write - Host " "  
        $fileUrl - ForegroundColor Green  
        $manager = $item.file.GetLimitedWebPartManager([System.Web.UI.WebControls.Webparts.PersonalizationScope]::Shared);  
        $wps = $manager.webparts  
        $wps | select - object @   
        {  
            Expression =  
            {  
                $pWeb.Url  
            };  
            Label = "Web URL"  
        }, @ {  
            Expression =  
            {  
                $fileUrl  
            };  
            Label = "Page URL"  
        }, DisplayTitle, IsVisible, @  
          {  
            Expression =   
            {  
                $_.GetType().ToString()  
            };  
            Label = "Type"  
        }  

    }  
} else  
  
{  
    Write - Host " Not a publishing web:"  
    $web.Url ". Looking for Site Pages library." - ForegroundColor Magenta  
    $pages = $null  
    $pages = $web.Lists["Pages"]  

    if ($pages)  
    {  
        Write - Host " "  
        $pages.Title "found." - ForegroundColor Green  

        foreach($item in $pages.Items)  
        {  
            $fileUrl = $webUrl + "/" + $item.File.Url  
            $manager = $item.file.GetLimitedWebPartManager([System.Web.UI.WebControls.Webparts.PersonalizationScope]::Shared);  
            $wps = $manager.webparts  
            $wps | select - object @   
            {  
                Expression =  
                {  
                    $pWeb.Url  
                };  
                Label = "Web URL"  
            }, @ {  
                Expression =  
                {  
                    $fileUrl  
                };  
                Label = "Page URL"  
            }, DisplayTitle, IsVisible, @   
             {  
                Expression =  
                {  
                    $_.GetType().ToString()  
                };  
                Label = "Type"  
            }  

        }  
        Write - Host "Press any key to continue..."  
        $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null  
    } else {  
        Write - Host " Site Pages library not found." - ForegroundColor Red  
    }  
}  
Write - Host "Press any key to continue..."  
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null  
Write - Host "... completed processing"  
$web "..." - ForegroundColor Magenta  
Write - Host "Press any key to continue..."  
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null  
}  
}  

$row = enumerateWebParts('http://bmfthnitd125:2222/')  
$row | Out - GridView  

Write - Host "Press any key to continue..."  
$Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyUp") > $null

Which Provider who can Give You The Best and Recommended SharePoint 2013 Hosting?

Happily, there are several reliable and recommended Web hosting out there that can help you get a handle on site speed and work to increase your SharePoint 2013 web rank. We are here to recommend you HostForLIFEASP.NET. HostForLIFEASP.NET is the most popular choice for people looking to host for the first time at an affordable price in Europe.

Their regular price starts at € 3.00/month only. Customers are allowed to decide on quarterly and annual plan supported their own desires. HostForLIFEASP.NET guarantees “No Hidden Fees” and industry leading ‘30 Days Cash Back’, folks might ask for a full refund if they cancel the service at intervals the first thirty days.

HostForLIFEASP.NET also give their customers an opportunity to create some cash by providing reseller hosting accounts. you’ll purchase their reseller hosting account, host unlimited websites thereon and even have the prospect to sell a number of your hosting area to others. This could be one amongst the best ways that of creating some cash on-line. You are doing not have to be compelled to worry concerning hosting stuff as they’ll beware of all the hosting desires of your shoppers.

hostforlifehttp://HostForLIFEASP.NET