-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #662 from reshmee011/reindexsites
new sample to reindex sites
- Loading branch information
Showing
4 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
plugin: add-to-gallery | ||
--- | ||
|
||
# Reindex SharePoint sites | ||
|
||
## Summary | ||
|
||
Keeping your SharePoint environment up-to-date is crucial, especially after making schema changes. This PnP PowerShell script streamlines the process of reindexing sites, libraries, or lists to ensure that search results remain accurate and relevant. | ||
|
||
# [PnP PowerShell](#tab/pnpps) | ||
|
||
```PowerShell | ||
#Set Parameters | ||
$AdminCenterURL="https://contoso-admin.sharepoint.com" | ||
Connect-PnPOnline -Url $AdminCenterURL -Interactive | ||
$m365Sites = Get-PnPTenantSite -Detailed | Where-Object {($_.Url -like '*/teams-*' -or $_.Template -eq 'TEAMCHANNEL#1') -and $_.Template -ne 'RedirectSite#0' } #filter to exclude redirect sites and to include team channel sites in the list | ||
$m365Sites | ForEach-Object { | ||
Connect-PnPOnline -Url $_.Url -Interactive | ||
#Request Reindex | ||
Request-PnPReIndexWeb | ||
Write-host "Reindexing: " $web $_.Url | ||
} | ||
``` | ||
|
||
[!INCLUDE [More about PnP PowerShell](../../docfx/includes/MORE-PNPPS.md)] | ||
|
||
*** | ||
|
||
## Contributors | ||
| Author(s) | | ||
|-----------| | ||
| [Reshmee Auckloo](https://github.com/reshmee011)| | ||
|
||
|
||
[!INCLUDE [DISCLAIMER](../../docfx/includes/DISCLAIMER.md)] | ||
<img src="https://m365-visitor-stats.azurewebsites.net/script-samples/scripts/spo-reindex-sites" aria-hidden="true" /> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
[ | ||
{ | ||
"schema": null, | ||
"name": "spo-reindex-sites", | ||
"version": null, | ||
"source": "pnp", | ||
"title": "Reindex SharePoint sites", | ||
"url": "https://pnp.github.io/script-samples/spo-reindex-sites/README.html", | ||
"creationDateTime": "2024-02-19", | ||
"updateDateTime": "2024-02-19", | ||
"shortDescription": "Keeping your SharePoint environment up-to-date is crucial, especially after making schema changes - this script streamlines the process of reindexing sites, libraries, or lists. ", | ||
"longDescription": null, | ||
"products": [ | ||
"SharePoint" | ||
], | ||
"categories": [ | ||
"Configure" | ||
], | ||
"tags": [ | ||
"Connect-PnPOnline", | ||
"Get-PnPTenantSite", | ||
"Request-PnPReIndexWeb" | ||
], | ||
"metadata": [ | ||
{ | ||
"key": "PNP-POWERSHELL", | ||
"value": "2.3.0" | ||
} | ||
], | ||
"thumbnails": [ | ||
{ | ||
"type": "image", | ||
"order": 100, | ||
"url": "https://raw.githubusercontent.com/pnp/script-samples/main/scripts/spo-reindex-sites/assets/preview.png", | ||
"alt": "preview image for the sample", | ||
"slides": null | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"gitHubAccount": "reshmee011", | ||
"company": "", | ||
"pictureUrl": "https://avatars.githubusercontent.com/u/7693852?v=4", | ||
"name": "Reshmee Auckloo" | ||
} | ||
], | ||
"references": [ | ||
{ | ||
"name": "Want to learn more about PnP PowerShell and the cmdlets", | ||
"description": "Check out the PnP PowerShell site to get started and for the reference to the cmdlets.", | ||
"url": "https://aka.ms/pnp/powershell" | ||
} | ||
] | ||
} | ||
] |