This blog helps you to retrive all Site Collections in SharePoint Online, using PowerShell method.

Steps
  1. Open SharePoint Management Shell.
  2. Copy the code given below and paste it.
  3. Run the code.
  1. ##########################
  2. #Script : Below Script will Get All Site Collections in Office 365 SharePoint Online
  3. #Author : Gowtham Rajamanickam
  4. #Date :16-03-2017
  5. #Version:1.0
  6. #########################
  7. #Before Run the Scritp you must load the Client Assembly files
  8. Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
  9. Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
  10. #Variables for Processing
  11. $AdminUrl = "https://gowthamr.sharepoint.com/"
  12. $UserName= "[email protected]"
  13. $Password = "Enter your Password here"
  14. $SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force
  15. $Credentials = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $UserName, $SecurePassword
  16. Connect-SPOService -Url $AdminUrl -Credential $Credentials
  17. $SiteColl = Get-SPOSite
  18. foreach($Site in $SiteColl)
  19. {
  20. Write-host $Site.Url
  21. }
Was my blog helpful? Was any relevant content missing? If so, please let us know what's confusing or missing at the bottom of this page.

Thanks for reading my blog.