¿Cómo saber quién creó un sitio en SharePoint?
¿Alguna vez quisiste saber quién creó un sitio de SharePoint? ¡Lo siento! ¡No hay forma de saber quién creó un sitio desde la interfaz de usuario de SharePoint! No puede obtener los valores "Creado por" o "Creado el" en ninguna parte. ¡Pero PowerShell es nuestro salvador! Veamos quién creó un sitio de SharePoint usando PowerShell:
Descubra quién creó un sitio de SharePoint
Simplemente ejecute el siguiente script de PowerShell para encontrar quién creó un sitio de SharePoint:
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get the Web
$web = Get-SPWeb "https://portal.crescent.com/sites/Sales"
#Get Site Creator and Created Date
write-host "Site Created by:"$web.Author
Write-host "Created on:" $web.Created
Este PowerShell le indica quién creó una colección de sitios o un subsitio.
SharePoint Online: PowerShell para saber quién creó el sitio
De manera similar, para saber quién creó un sitio en SharePoint Online, use este script de PowerShell:
#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://Crescent.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
También puede obtener la fecha y hora de creación del sitio como:
$Web.Created.DateTime
PnP PowerShell para obtener el creador de un sitio
Para saber quién creó un sitio en SharePoint Online, use este PnP PowerShell:
$SiteURL = "https://crescent.sharepoint.com/sites/HR"
#Connect to Site
Connect-PnPOnline $SiteURL -Interactive
#Get the Web
$Web = Get-PnPWeb
#Get the author - who has created the site
Get-PnPProperty -ClientObject $Web -Property Author
Publicación relacionada: Determinar quién creó una vista de lista en SharePoint
