none
Find webpart added to page using powershell RRS feed

All replies

  • Sounds like the library may have been renamed. A line in that script checks to see if the publishing feature is activated so you're looking the correct library. Have you tried direct linking to it via .../sites/SiteName/SitePages? If you're permissioned to see it you should be taken into it, from which it display name should be visible.

    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles: CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

    Thursday, October 5, 2017 1:12 PM
    Answerer
  • Hi,

    There is a else part in which it goes to the other sites. It is checking as below

     $sitepages = [Microsoft.Sharepoint.Utilities.SpUtility]::GetLocalizedString('$Resources:WikiLibDefaultTitle',"core",$web.UICulture.LCID) 
    
                    $pages = $null 
                    $pages = $web.Lists[$sitepages] 
    
                    if ($pages){ 
    
                        foreach ($file in $pages.Items) { 
                            $fileUrl = $web.Url + "/" + $file.File.Url 
    
                            $manager = $file.file.GetLimitedWebPartManager([System.Web.UI.WebControls.Webparts.PersonalizationScope]::Shared); 
    
                            $webparts = $manager.webparts 
    
                            $webparts | %{ 
                                ac $logfile "$fileUrl, $($_.DisplayTitle), $($_.GetType().ToString()), $($_.IsVisible)" 
    
                                if ($_.DisplayTitle -match $WP -and -not [string]::IsNullOrEmpty($WP)){ 
                                    ac $logfilewp "$fileUrl, $($_.DisplayTitle), $($_.GetType().ToString()), $($_.IsVisible)" 
    
                                    $logfilecontrol = 1 
                                } 
                            } 
                        } 
    

    This is not checking all the pages under "All files"

    Thanks

    Thursday, October 5, 2017 1:18 PM
  • Hi,

    Any help on this?

    Thanks

    Friday, October 6, 2017 2:32 PM