SharePoint Connector: Via.SpFetchDiagnostics.exe Command Line Tool
This tool allows to perform diagnostics Fetches on SharePoint references. Opposite to fetch requests this tool does not include document conversion and there are no changes made to Locator database.
This tool is located in Program Files\ayfie\Locator\SharePoint\SpFetchDiagnostics and is included with SharePoint connector installation starting from version 2.9.6.0.
This tool can be provided with single source reference or path to a file containing list of source references to fetch. Keep in mind that SharePoint connector supports fetching only list items, thus all Web or List references provided to this script will be skipped. When preparing the file, each source reference has to be added in a new line. You can use the following PostgreSQL query to generate file with all SharePoint repository references that support fetching:
Copy (SELECT reference FROM doc.source_reference WHERE repository_id = ? AND reference like '%v#li#3') To 'C:/Example/test.csv' With CSV
- Important Note: You have to manually update the value in <appSettings file="DataAccess.config">. You can use Program Files\ayfie\Locator\SharePoint\Via.SharePoint.Fetch.Service.exe.config as an example.
Allowable parameters are:
/repository|rid:<Int32> /reference|ref:<String> /referencepath|rp:<String> /outputtofile|f[:<Boolean>] /outputtoconsole|c[:<Boolean>] /outputtologs|l[:<Boolean>] /delete|d[:<Boolean>] /repeat|r:<Int32> /help|h|?[:<Boolean>] | Specify repository ID for the configuration (required) SharePoint document reference string Path to file containing list of SharePoint document references Writes result output to separate file: (true, false). Default true. Writes result output to console: (true, false). Default false. Writes result output to logs: (true, false). Default false. Delete fetched files: (true, false). Default true. Number of times this command should be repeated. Default 0. Get help |
Examples:
Via.SpFetchDiagnostics.exe /rid:4 /rp:C:/Example/test.csv
Via.SpFetchDiagnostics.exe /rid:4 /ref:f533dabb-e274-4454-a70c-73cbc25feec3;/;3c593204-2795-48bc-b38b-a8e42187cab1;6a76fff4-9378-480e-b448-c50b0d72b70c;10;v#li#3
The tool will return results in two ways: formatted text and csv. Results are located under Program Files\ayfie\Locator\SharePoint\SpFetchDiagnostics\Results path. The generated csv you can import into spreadsheet application and apply filters/sorting.
For single or few source reference you might rather use the formatted response. Here is an example result:
[06/24/2020 06:48:50] [+] Starting: Fetch 263 source references. [06/24/2020 06:48:50] [+] Starting: Fetching source reference: 63c329fb-8013-4670-ab0c-5b0ce998ecb0;/searchspapp;495a8f73-eb2a-4313-b62e-dbc5c29a1bf6;90c2c12a-48bb-4f5f-8ccb-71f103d17593;10;v#li#3. [06/24/2020 06:48:50] [+] Starting: Loading Taxonomy session. [06/24/2020 06:48:50] [+] Starting: Waiting for SharePoint to execute query. [06/24/2020 06:48:52] [-] Finished in 00:00:01.5381664: Waiting for SharePoint to execute query [06/24/2020 06:48:52] [-] Finished in 00:00:01.6548273: Loading Taxonomy session [06/24/2020 06:48:52] [+] Starting: Validating TermStore. [06/24/2020 06:48:52] [+] Starting: Waiting for SharePoint to execute query. [06/24/2020 06:48:52] [-] Finished in 00:00:00.2599067: Waiting for SharePoint to execute query [06/24/2020 06:48:52] [-] Finished in 00:00:00.3381408: Validating TermStore [06/24/2020 06:48:52] [+] Starting: Loading TermStores. [06/24/2020 06:48:52] [+] Starting: Waiting for SharePoint to execute query. [06/24/2020 06:48:52] [-] Finished in 00:00:00.0978618: Waiting for SharePoint to execute query [06/24/2020 06:48:52] [-] Finished in 00:00:00.1835846: Loading TermStores [06/24/2020 06:48:52] [+] Starting: Searching for item with reference: 63c329fb-8013-4670-ab0c-5b0ce998ecb0;/searchspapp;495a8f73-eb2a-4313-b62e-dbc5c29a1bf6;90c2c12a-48bb-4f5f-8ccb-71f103d17593;10;v#li#3. [06/24/2020 06:48:52] [+] Starting: Preparing search query. [06/24/2020 06:48:53] [+] Starting: Loading SharePoint site. [06/24/2020 06:48:53] [+] Starting: Waiting for SharePoint to execute query. [06/24/2020 06:48:53] [-] Finished in 00:00:00.2496331: Waiting for SharePoint to execute query [06/24/2020 06:48:53] [+] Starting: Initializing SharePointWeb. [06/24/2020 06:48:53] [-] Finished in 00:00:00.0022494: Initializing SharePointWeb [06/24/2020 06:48:53] [-] Finished in 00:00:00.3318017: Loading SharePoint site [06/24/2020 06:48:53] [-] Finished in 00:00:00.3687580: Preparing search query [06/24/2020 06:48:53] [+] Starting: Waiting for SharePoint to execute query. [06/24/2020 06:48:53] [-] Finished in 00:00:00.5300182: Waiting for SharePoint to execute query [06/24/2020 06:48:54] [-] Finished in 00:00:01.0782626: Searching for item with reference: 63c329fb-8013-4670-ab0c-5b0ce998ecb0;/searchspapp;495a8f73-eb2a-4313-b62e-dbc5c29a1bf6;90c2c12a-48bb-4f5f-8ccb-71f103d17593;10;v#li#3 [06/24/2020 06:48:54] [+] Starting: Fetching files from document Search REST Service URL. [06/24/2020 06:48:54] [+] Starting: Fetching document attachments. [06/24/2020 06:48:54] [-] Finished in 00:00:00.0038092: Fetching document attachments [06/24/2020 06:48:54] [-] Finished in 00:00:00.0099823: Fetching files from document Search REST Service URL [06/24/2020 06:48:54] [-] Finished in 00:00:03.4359795: Fetching source reference: 63c329fb-8013-4670-ab0c-5b0ce998ecb0;/searchspapp;495a8f73-eb2a-4313-b62e-dbc5c29a1bf6;90c2c12a-48bb-4f5f-8ccb-71f103d17593;10;v#li#3 ... [06/24/2020 06:51:27] [+] Starting: Fetching source reference: 67956843-e837-467e-ba9c-85c5c0f577d8;/qa/security_1c/secsite_2a;cc8e1439-5945-4096-9d4b-98653a0ea0c1;b14de8a0-ff73-4499-a83a-e0373e62babc;1;v#li#3. [06/24/2020 06:51:27] [+] Starting: Searching for item with reference: 67956843-e837-467e-ba9c-85c5c0f577d8;/qa/security_1c/secsite_2a;cc8e1439-5945-4096-9d4b-98653a0ea0c1;b14de8a0-ff73-4499-a83a-e0373e62babc;1;v#li#3. [06/24/2020 06:51:27] [+] Starting: Preparing search query. [06/24/2020 06:51:27] [+] Starting: Loading SharePoint site. [06/24/2020 06:51:27] [+] Starting: Waiting for SharePoint to execute query. [06/24/2020 06:51:27] [-] Finished in 00:00:00.1339197: Waiting for SharePoint to execute query [06/24/2020 06:51:27] [+] Starting: Initializing SharePointWeb. [06/24/2020 06:51:27] [-] Finished in 00:00:00.0002465: Initializing SharePointWeb [06/24/2020 06:51:27] [-] Finished in 00:00:00.2084966: Loading SharePoint site [06/24/2020 06:51:27] [-] Finished in 00:00:00.2114381: Preparing search query [06/24/2020 06:51:27] [+] Starting: Waiting for SharePoint to execute query. [06/24/2020 06:51:27] [-] Finished in 00:00:00.1043649: Waiting for SharePoint to execute query [06/24/2020 06:51:27] [-] Finished in 00:00:00.3915957: Searching for item with reference: 67956843-e837-467e-ba9c-85c5c0f577d8;/qa/security_1c/secsite_2a;cc8e1439-5945-4096-9d4b-98653a0ea0c1;b14de8a0-ff73-4499-a83a-e0373e62babc;1;v#li#3 [06/24/2020 06:51:27] [+] Starting: Fetching files from document SecItem_2ACA. [06/24/2020 06:51:27] [+] Starting: Fetching document attachments. [06/24/2020 06:51:28] [+] Starting: Waiting for SharePoint to execute query. [06/24/2020 06:51:28] [-] Finished in 00:00:00.0673547: Waiting for SharePoint to execute query [06/24/2020 06:51:28] [+] Starting: Fetching file from https://viaworks4.sharepoint.com/QA/Security_1C/SecSite_2A/Lists/SecList_2A_C/Attachments/1/QASecCars2.xlsx. [06/24/2020 06:51:28] [+] Starting: Waiting for response from https://viaworks4.sharepoint.com/QA/Security_1C/SecSite_2A/Lists/SecList_2A_C/Attachments/1/QASecCars2.xlsx. [06/24/2020 06:51:28] [-] Finished in 00:00:00.0879521: Waiting for response from https://viaworks4.sharepoint.com/QA/Security_1C/SecSite_2A/Lists/SecList_2A_C/Attachments/1/QASecCars2.xlsx [06/24/2020 06:51:28] [-] Finished in 00:00:00.0889743: Fetching file from https://viaworks4.sharepoint.com/QA/Security_1C/SecSite_2A/Lists/SecList_2A_C/Attachments/1/QASecCars2.xlsx [06/24/2020 06:51:28] [-] Finished in 00:00:00.2328471: Fetching document attachments [06/24/2020 06:51:28] [-] Finished in 00:00:00.2332734: Fetching files from document SecItem_2ACA [06/24/2020 06:51:28] [-] Finished in 00:00:00.6257865: Fetching source reference: 67956843-e837-467e-ba9c-85c5c0f577d8;/qa/security_1c/secsite_2a;cc8e1439-5945-4096-9d4b-98653a0ea0c1;b14de8a0-ff73-4499-a83a-e0373e62babc;1;v#li#3 [06/24/2020 06:51:28] [-] Finished in 00:02:37.5118342: Fetch 263 source references
ayfie