image

Add-PSSnapin "Microsoft.SharePoint.PowerShell" $spsite = Get-SPSite "http://2013-sp/" $web = $spsite.RootWeb $pageURL = "SitePages/Home.aspx" $wpm = $web.GetLimitedWebPartManager($pageURL, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared) $searchWP = $wpm.WebParts | where-object { $_.WebBrowsableObject.GetType().Name -eq "SearchBoxScriptWebPart" } if($searchWP -ne $null) { $searchWP.TryInplaceQuery = 0 $searchWP.ResultsPageAddress = "CustomSearchResultsPage.aspx" $wpm.SaveChanges($searchWP) }