Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. stsadm -o enumsites
  2.  
  3. Get-SPWebApplication -Limit All | Get-SPSite | Get-SPWeb | Format-Table -Property Title, URL
  4.  
  5. [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null
  6. $siteUrl = Read-Host "Enter Site URL"
  7. $rootSite = New-Object Microsoft.SharePoint.SPSite($siteUrl)
  8. $spWebApp = $rootSite.WebApplication
  9. $count = 0
  10. write-host "Site Collections"
  11. write-host ""
  12. foreach ($site in $spWebApp.Sites) {
  13. $count++
  14. write-host "Site Collections URL --> -->" $site.URL
  15. write-host ""
  16. write-host "SubSites"
  17. write-host ""
  18. foreach ($web in $site.AllWebs) {
  19. $count++
  20. write-host "SubSite URL --> --> -->" $web.URL
  21. write-host ""
  22. }
  23. }
  24. write-host "Total Count :" $count
  25.  
  26. http://webapplication [is a root site collection]
  27.  
  28. http://webapplication/subsite1
  29. http://webapplication/subsite1/subsite1.1
  30. http://webapplication/subsite1/subsite1.1/subsite1.2
  31.  
  32. http://webapplication/subsite2
  33. http://webapplication/subsite2/subsite2.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement