How to Find Who Created a Site in SharePoint?

Ever wanted to find out who has created a SharePoint site? Sorry! There is no way from SharePoint user Interface to get who created a site! You can't get "Created By" or "Created On" values anywhere. But PowerShell is our rescuer! Lets see who has created a SharePoint site using PowerShell:
Find Who Created a Site in SharePoint Online using PowerShell

Find Out Who Created a SharePoint Site
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Get the Web
$web = Get-SPWeb "http://portal.crescent.com/sites/Sales"

#Get Site Creator and Created Date 
write-host "Site Created by:"$web.Author
Write-host "Created on:" $web.Created 
This PowerShell gets you who created a site collection or subsite.

SharePoint Online: PowerShell to Get Who Created Site 
Similarly, to find who created a site in SharePoint Online, use this PowerShell script:
#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 Parameters
$SiteURL="https://crescenttech.sharepoint.com/sites/marketing"

#Setup 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.Load($Web.Author)
$Ctx.ExecuteQuery()

#Find who created a site
$Web.Author | Select LoginName, Email, Title

You can also get site created date and time as:
$Web.Created.DateTime

Related post: Determine who created a list view in SharePoint
How to Find Who Created a Site in SharePoint? How to Find Who Created a Site in SharePoint? Reviewed by Salaudeen Rajack on February 16, 2018 Rating: 5

1 comment:

  1. Hello, I tried the code for sharepoint online, but get error message below.

    Cannot find an overload for "Load" and the argument count: "1".
    At line:19 char:1
    + $Ctx.Load($Web.Author)
    + ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

    ReplyDelete

Please Login and comment to get your questions answered!

Powered by Blogger.