Activate Global Search for Modern Site

The Modern SharePoint by default only allows you to search inside that specific site. However, the new version of SharePoint PNP PowerShell allows you to activate the Search for all SharePoint instead of just that specific site.

Update the PNP PowerShell for the latest version.

Update-Module SharePointPnPPowerShell*
Connect-PnPOnline -Url "" -UseWebLogin
 $web = Get-PnPWeb
 #1 to activate Global Search and 0 to deactivate Global Search
 $web.SearchScope = 1 
 Write-Host "Done" -BackgroundColor Green	
 Write-Host "No permission" -BackgroundColor Red	
Write-Host "All Done"
Write-Host "Press any key to Close..."


The Modern Site where you run this script will now search on all SharePoint Sites. To make the search to go on original behavior on SearchScope switch the value for 0.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *