3
votes
Accepted
Restrict PnPSearchQuery to just site and subsites not all tenant sites
You can use try using Path property in your search query to limit search results to specific SharePoint site.
For example:
$results=Submit-PnPSearchQuery -Query "N/A OR NA Path:https://myCompany....
2
votes
CSOM PowerShell script - moving to modern authentication
If you are using the old SharePoint dlls. Make sure you install or are using the last PnP powershell library.
https://pnp.github.io/powershell/
Then you can use the following code to prompt the MFA ...
1
vote
Set-PnPList or Set-PnPField fails to update immediately after a new list is created using Copy-PnPList
In the third line of the code snippet, your Connect-PnPOnline request is missing the ReturnConnection parameter.
For Set-PnPField and Set-PnPList, you haven't specified a PnPConnection for the target ...
1
vote
Accepted
SharePoint Online - unused content report
you can use graph api GET /reports/getSharePointSiteUsageDetail(period='{period_value}')
sample
you can use native page in SharePoint Admin center, you check Actives sites and "Last Activity"...
1
vote
Add-SPOTheme : The term 'Add-SPOTheme' is not recognized as the name of a cmdlet, function, script file, or operable program
Your script is connecting to SharePoint using a cmdlet from the PnP.PowerShell module but is then using the Add-SPOTheme cmdlet from the Microsoft.Online.SharePoint.PowerShell module.
To connect to ...
1
vote
Accepted
Need a powershell script to update 300+ SharePoint SitePages
@Taco_Buffet
Got it figured out! Here's what I used to gather all highlighted content WebParts for all site pages for a specific site. Was able to change layoutID from "Card" ("Grid&...
1
vote
Get all comments from modern Site pages in SharePoint Online
You can use the REST API to call the /Comments endpoint:
/_api/web/lists/GetByTitle('Site Pages')/GetItemById(x)/Comments
Here is the PowerShell code:
$SiteURL = "https://yourtenant.sharepoint....
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
sharepoint-online-powershell × 15sharepoint-online × 12
powershell × 6
pnp-powershell × 5
list × 1
search × 1
csom × 1
calendar × 1
site-template × 1
modern-pages × 1
sitepages × 1
document-id × 1
site-usage × 1
secure-store × 1
powershell-script × 1
list-comments × 1