Site collection creation time using PowerShell

This script will show you the site collection creation time for each site collection using PowerShell.
Try the following oneliner to get all the information you need:

Get-SPSite -Limit All | %{$root = $_.rootweb; $date = $root.created.toShortDateString(); Write-Host "$($root.url) was created on $($date)"}

Site collection creation time

3 thoughts on “Site collection creation time using PowerShell

  • Scipt did not help.

    Error :

    Get-SPSite : The term ‘Get-SPSite’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of
    the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + Get-SPSite -Limit All | %{$root = $_.rootweb; $date = $root.created.t …
    + ~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (Get-SPSite:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    • Hi Ajay,

      You need to run this in the SharePoint Management Shell or use asnp *sh* to add the snap-in for SharePoint. (Only works for on-premises SharePoint)

Leave a Reply

Your email address will not be published. Required fields are marked *