Get SharePoint Site Collection Created Date using PowerShell

Requirement: I had to generate a report for management review on the list of site collections created in the past month. 

How to Get the Site created date using PowerShell?

To get the SharePoint Site Collection Created Date, we can use PowerShell as there is no UI to view the site creation date in SharePoint! But you can get the site creation date in SharePoint using PowerShell as:

Write-host (Get-SPSite "").RootWeb.created

Let’s get all sites created in the past one month based on the SharePoint site creation date using PowerShell:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get all site collections
$SitesColl = Get-SPSite -Limit All

#Get start date of Last Last Month
$LastMonth= (Get-Date).AddMonths(-1)

#Loop through all sites
ForEach($Site in $SitesColl)
    #Check site creation date
    if($Site.RootWeb.created -gt $LastMonth)
        $CreatedDate = $Site.RootWeb.created.toShortDateString()
        Write-Host "$($Site.RootWeb.url) was created on $($CreatedDate)"

Find all Site collections created today:

Unlike the above code, let’s use a one-liner to find all site collections created today:

Get-SPSite -Limit All | ? { $_.RootWeb.Created -eq[DateTime]::Today} | select Url, @{Name="Created";Expression={$_.RootWeb.Created}}

Find the created date of a Subsite:

How to tell when a SharePoint site was created? Well, a similar code applies for finding a subsite’s created date.

Get-SPweb "" | Select @{Name="Created";Expression={$_.Created}}

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

5 thoughts on “Get SharePoint Site Collection Created Date using PowerShell

  • How would you edit the script to include subsites and their creation date?

    • Here you go: Get-SPWebApplication | Get-SPSite | Get-SPWeb -Limit All | ForEach-Object { write-host Site Name: $_.Created }

  • I have the exact opposite requirement. I need to find all locked sites (not a problem) and the date they were locked for a data retention policy review. I can’t find anything on the web that will give me the date a site was locked. Any ideas?

  • Similar requirement to achieve in SharePoint Online??


Leave a Reply

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