Udostępnij za pośrednictwem


How to Run CSOM-EnumerateSiteUrls.ps1 Using CSOM and Search to Gather List of Personal Sites in SharePoint Online

This post provides step-by-step instructions to help you understand how to successfully run the example PowerShell script available in the Microsoft download center "CSOM-EnumerateSiteUrls.ps1", which uses the SharePoint client side object model (CSOM) and Search to gather a list of personal sites in Office 365 SharePoint Online.

Enumerate Site URLs in SharePoint Online
https://www.microsoft.com/en-us/download/details.aspx?id=44294

  • File Name: CSOM-EnumerateSiteUrls.ps1
  • Version: Oct2014
  • Date Published: 10/3/2014
  • File Size: 11 KB

Prior to running the example PowerShell script, you must install client components SDK in order to run SharePoint 2013 CSOM…

SharePoint Server 2013 Client Components SDK
https://www.microsoft.com/en-us/download/details.aspx?id=35585

 

How To Run CSOM-EnumerateSiteUrls.ps1

1. Launch a Windows Powershell window and Run As Administrator. 

Note: Do NOT launch SharePoint Online Management Shell window!  Do NOT execute any Connect-SPOService cmdlet!  Otherwise, script will fail with the error... 'New-Object : Cannot find an overload for "KeywordQuery" and the argument count: "1"'

2. Change directory to location of the PowerShell script.

3. Execute the PowerShell script.

.\CSOM-EnumerateSiteUrls.ps1

4. Script prompts to supply value for MySiteHostURL parameter value. Supply value similar to following, where "<tenant>" is your Office 365 tenant (example, "contoso").

https://<tenant>-my.sharepoint.com

5. Script prompts to supply value for Adminlogin. Specify a Global Administrator account for your tenant.

admin@<tenant>.onmicrosoft.com

6. Script prompts to "Please enter your password" for <Adminlogin>.  Type password for the Global Admin account specified as Adminlogin parameter. Then press Enter.

ADDITIONAL NOTES

I have test run the script successfully myself using installed SharePoint Client Components at version 15.0.4641.1002 (as verified in Windows Programs and Features).

Installed location of DLLs was...
C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\

Microsoft.SharePoint.Client.dll
8/1/2014
V15.0.4641.1000

Microsoft.SharePoint.Client.Runtime.dll
8/1/2014
15.0.4561.1000

Microsoft.SharePoint.Client.Taxonomy.dll
8/1/2014
V15.0.4420.1017

Comments