Searching Sharepoint in PowerShell

New Contributor

Hello all,


First post from me! I have been struggling for a couple of days with a PowerShell issue - I have a script that successfully  opens a SpreadSheet from one of those columns I get a list of IDs and I am trying to search our SharePoint site for all PDFs with those IDs in the title. I have tried a number of PNP PowerShell commands and seem to hit the same brick wall. I have tried with and without the connection parameter. Any ideas?






3 Replies
best response confirmed by Beau Cameron (MVP)

@CrossingTheMoor Hi. First, you don't need that connection parameter. Once you connect to your site via Connect-PnPonline, you are already connected. 

Second, the error that you have is because your Connect-PnP Online Command is wrong. You want to connect to the site specifically, not the page on your site.

Connect-PnPOnline -url -UseWebLogin

Thanks @Beau Cameron - that got it - seems pretty slow but getting loads of data back now.


This cmdlet retrieves diagnostic information for all or specified search components in the active topology of a Search Service Application.

If you don't specify any of the optional parameters, the cmdlet will retrieve the health status of all the search components within the Search Service Application. Each search component will have one of the following states:

Active: The search component is running OK
Degraded: The search component is in a status where it cannot perform all operations correctly. The reason for the degraded status is typically a transient situation related to a restart or network issues.
Failed: The search component is not running. This status indicated that the component cannot perform operations correctly.
Unknown: The component can't be reached. The reason for the unknown status is typically hardware or communication issues.
If you have defined more than one Index component for a partition in your search topology, this cmdlet will indicate which index component that has the Primary role for this partition.

You can use the cmdlet to output the following additional information:

List the status of background activities (batch jobs) initiated by the search components
List the status of background activities (batch jobs) initiated by the search components
List detailed diagnostic information for the index component
Debug information that may be used by Microsoft for detailed issue resolution
If you don't want to iterate over the output in a script, use the Text parameter. If you do not use the Text parameter, the cmdlet will output a set of objects that have the following properties:

string Name: the name of a search component, a health report item or a constellation property
string State: the status of the search component
string Level: when you are using the HealthReport parameter, this property indicates the importance level of each health report item (Error, Warning, Info, Verbose)
string Message: additional information that is provided as a text string
ReadOnlyDictionary<string,string>Details: dictionary name/value pairs that provide additional diagnostic information