This blogs will helps you to retrive all SubSites under Site Collections in SharePoint online using PowerShell Method.

Steps
  1. Open SharePoint Management Shell.
  2. Copy the below Code and paste it.
  3. Run the Code
  1. ##########################
  2. #Script : Below Script will retrieve List Url in SharePoint 2013 Online in Office 365 SharePoint Online
  3. #Author : Gowtham Rajamanickam
  4. #Date : 21-03-2017
  5. #Version:1.0
  6. #########################
  7. Function Get-SPOCredentials([string]$UserName,[string]$Password)
  8. {
  9. $SecurePassword = $Password | ConvertTo-SecureString -AsPlainText -Force
  10. return New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName, $SecurePassword)
  11. }
  12. $context = New-Object Microsoft.SharePoint.Client.ClientContext($Url)
  13. $context.Credentials = Get-SPOCredentials -UserName "Enter Your 0365 user Name " -Password "Enter Your Password Here"
  14. $list = $context.Web.Lists.GetByTitle($listTitle)
  15. $context.Load($list.RootFolder)
  16. $context.ExecuteQuery()
  17. $listUrl = $list.RootFolder.ServerRelativeUrl
  18. Write-Host $listUrl
Conclusion

Was my Blog helpful?Was it missing content? If so, please let us know what's confusing or missing at the bottom of this page.

Thanks for reading my blogs.