SOLVED

Searching Sharepoint in PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-1682092%22%20slang%3D%22en-US%22%3ESearching%20Sharepoint%20in%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1682092%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20all%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirst%20post%20from%20me!%20I%20have%20been%20struggling%20for%20a%20couple%20of%20days%20with%20a%20PowerShell%20issue%20-%20I%20have%20a%20script%20that%20successfully%26nbsp%3B%20opens%20a%20SpreadSheet%20from%20one%20of%20those%20columns%20I%20get%20a%20list%20of%20IDs%20and%20I%20am%20trying%20to%20search%20our%20SharePoint%20site%20for%20all%20PDFs%20with%20those%20IDs%20in%20the%20title.%20I%20have%20tried%20a%20number%20of%20PNP%20PowerShell%20commands%20and%20seem%20to%20hit%20the%20same%20brick%20wall.%20Any%20ideas%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22CrossingTheMoor_0-1600410044777.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F219453i3AB48A6BF309CA55%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22CrossingTheMoor_0-1600410044777.png%22%20alt%3D%22CrossingTheMoor_0-1600410044777.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1682092%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1685995%22%20slang%3D%22en-US%22%3ERe%3A%20Searching%20Sharepoint%20in%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1685995%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F798367%22%20target%3D%22_blank%22%3E%40CrossingTheMoor%3C%2FA%3E%26nbsp%3BHi.%20First%2C%20you%20don't%20need%20that%20connection%20parameter.%20Once%20you%20connect%20to%20your%20site%20via%20Connect-PnPonline%2C%20you%20are%20already%20connected.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ESecond%2C%20the%20error%20that%20you%20have%20is%20because%20your%20Connect-PnP%20Online%20Command%20is%20wrong.%20You%20want%20to%20connect%20to%20the%20site%20specifically%2C%20not%20the%20page%20on%20your%20site.%3CBR%20%2F%3E%3CBR%20%2F%3EConnect-PnPOnline%20-url%20%3CA%20href%3D%22https%3A%2F%2Fyoursite.sharepoint.com%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fyoursite.sharepoint.com%3C%2FA%3E%20-UseWebLogin%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
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?

 

CrossingTheMoor_0-1600410236849.png

 

 

 

3 Replies
Highlighted
Best Response confirmed by Beau Cameron (MVP)
Solution

@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 https://yoursite.sharepoint.com -UseWebLogin

Highlighted

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

 

Highlighted
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