Using the Get-PnpSearchCrawlLog cmdlet wanted to filter the returned result set to a specific list. Before you begin, you’ll want to make sure you have access to the Crawl Log: https://yourSite-admin.sharepoint.com/_layouts/15/searchadmin/crawllogreadpermission.aspx
Connect-PnPOnline -Url "https://sharepointed.sharepoint.com/sites/food" -Credentials (Get-Credential)
$logs = Get-PnPSearchCrawlLog -filter "https://sharepointed.sharepoint.com/sites/food/Lists/tacos/"
foreach($l in $logs)
Write-Host " "
This will filter the returned results to a specific list. Note: when using Connect-PnPOnline I use my email address and App Password. App Password can be created/found here: https://account.activedirectory.windowsazure.com/AppPasswords.aspx
Get-PnPSearchCrawlLog details: https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/get-pnpsearchcrawllog?view=sharepoint-ps
Using Visual Studio Code and SharePoint PNP I was trying to make some updates to a list but I wasn’t able to connect to a site.
Connect-PnPOnline -Url "https://taco.sharepoint.com/" -Credentials $creds
Error I was receiving:
System.MissingMethodException: Method not found: ‘System.Runtime.Remoting.ObjectHandle System.Activator.CreateInstance(System.String, System.String)’.
I tried uninstalling VScode, removed all traces of SharePoint from my laptop, and cleared the GAC. Nothing worked.
Here is what did work:
- Open the Command Palette on Windows or Linux with Ctrl+Shift+P. On macOS, use Cmd+Shift+P.
- Search for Session.
- Click on PowerShell: Show Session Menu.
- Choose one of the ___ (x86) options
Not sure how, but I was using an x64 session and SharePoint PNP clearly didn’t like that.
Edit: Updated VScode to the latest version and it managed to reset my session settings. When this happened, it caused my CSOM scripts to report a The remote server returned an error: (400) Bad Request error. The fix above will resolve the error.