A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
Hi caXB,
Thanks for posting in the community. We are happy to help you.
Based on your description, I assume you mean changing the search scope for the Hub site from "Search across sites" to "all sites in the tenant" (including sites not associated with the Hub site).
If not, please point it out and let us know.
If so, you (the tenant's Global admin or SharePoint admin) can run the following PowerShell script in SharePoint Online Management Shell to change the hub site's default search scope from the Site level (value= 0) to the Tenant level (value = 1). Remember to change the $SiteURL parameter to your hub site URL.
For your reference:
Get started with SharePoint Online Management Shell
SharePoint Online: Change Default Search Scope from “Search This Site” to “Search All Sites”
Disclaimer*: Microsoft provides no assurances and/or warranties, implied or otherwise, and is not responsible for the information you receive from the third-party linked sites or any support related to technology.*
#Set Parameters
$SiteURL = "https://crescent.sharepoint.com/sites/Marketing"
#Get Credentials to connect
$Cred = Get-Credential
Try {
#Setup the context
$Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
$Ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.UserName,$Cred.Password)
#Get Web object
$Web = $Ctx.Web
$Ctx.Load($Web)
$Ctx.ExecuteQuery()
#Set search scope for the web to global
$Web.SearchScope = 1
$web.Update()
$Ctx.ExecuteQuery()
}
Catch {
write-host -f Red "Error:" $_.Exception.Message
}
After that, users will be able to search across your tenant (all sites) when using your hub site's site search.
If you have any updates or concerns about running the PowerShell script, please post back and let us know.
We look forward to your response. Thanks for your cooperation.
Sincerely,
George | Microsoft Community Moderator