kwizcom banner advertisement

SharePoint Online: Get Site Collection Created Date using PowerShell

Requirement: Get Site Collection creation date in SharePoint Online.

SharePoint Online: PowerShell to Get Site Creation Date
How to check SharePoint online site creation date? Well, There is no UI to get site creation date in SharePoint Online or in On-Premises. However, PowerShell can help to find SharePoint online site collection created date.
#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
 
#Set parameter values
$SiteURL="https://crescent.sharepoint.com/sites/Ops"

Try { 
        #Get Credentials to connect
        $Cred= Get-Credential
        $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
 
        #Setup the context
        $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
        $Ctx.Credentials = $Credentials
        
        #Get the Web
        $Web = $Ctx.Web
        $Ctx.Load($web)
 $Ctx.ExecuteQuery()

        Write-host -f Green "Site Collection Created Date:"$Web.created.toShortDateString()
     }
    Catch {
        write-host -f Red "Error Getting Site Collection Creation Date!" $_.Exception.Message
   }
SharePoint Online: Get Site Collection Created Date using PowerShell SharePoint Online: Get Site Collection Created Date using PowerShell Reviewed by Salaudeen Rajack on September 02, 2017 Rating: 5

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.