Get a list of site collection - Powershell

18,425

try this:

Get-SPSite -WebApplication http://myCompany.bofa.com:9966 -Limit All | 
  Select -ExpandProperty AllWebs | 
ft url, Title, Created -auto > c:\mysite.txt

if it were not enough you can try this:

Get-SPSite -WebApplication http://myCompany.bofa.com:9966 -Limit All | 
  Select -ExpandProperty AllWebs | 
ft url, Title, Created -auto | 
out-string -width 1024 > c:\mysite.txt # 1024 can me more or less depends the length you need
Share:
18,425
Ninja Cowgirl
Author by

Ninja Cowgirl

Updated on June 04, 2022

Comments

  • Ninja Cowgirl
    Ninja Cowgirl almost 2 years

    I am using the following PowerShell script to get a list of site collection for a web application. it works but url column cuts of after 25 or 30 letters. Any fix for this?

    Get-SPSite -WebApplication http://myCompany.bofa.com:9966 -Limit All | `
      Select -ExpandProperty AllWebs | select url, Title, Created > c:\mysite.txt
    

    Where I output to a file or screen same outcome where the url cuts off after 25 or 30 characters.

    Result looks like this:

    http://mycompany.bofa.co.... Site Title   8/12/2012 3:49:20 PM