Pages

Wednesday, 25 April 2018

Get All Site Collections & all Site in Web application using Powershell

How to Get all site Collections in SharePoint Web Application


Add-PSSnapIn "Microsoft.SharePoint.Powershell"
$SiteCollection= get-spsite -limit all -WebApplication https://Server

foreach($Site in $SiteCollection)
{
    foreach($web in $Site.AllWebs)
       {
        Write-Host $web.url
      }
     
}

More details: https://docs.microsoft.com/en-us/sharepoint/sites/view-all-site-collections

No comments:

Post a Comment