Hello @Pbala ,
Welcome to Q&A Forum!
Please run the below PowerShell script to change default search scope in SharePoint Online as site collection admin:
#Set Parameters
$SiteURL = "https://xxxx.sharepoint.com"
#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
}
Search scope enumeration values:
- DefaultScope = 0
- Tenant = 1
- Hub = 2
- Site = 3
Thanks,
Echo Du
================================
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.